lexxy 0.1.22.beta → 0.1.23.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/javascript/lexxy.js +184 -167
- data/app/assets/javascript/lexxy.js.br +0 -0
- data/app/assets/javascript/lexxy.js.gz +0 -0
- data/app/assets/javascript/lexxy.min.js +1 -1
- data/app/assets/javascript/lexxy.min.js.br +0 -0
- data/app/assets/javascript/lexxy.min.js.gz +0 -0
- data/app/assets/stylesheets/lexxy-editor.css +93 -51
- data/app/assets/stylesheets/lexxy-variables.css +1 -1
- data/lib/lexxy/engine.rb +4 -2
- data/lib/lexxy/version.rb +1 -1
- metadata +1 -1
|
@@ -7,4 +7,4 @@ import{DirectUpload as e}from"@rails/activestorage";
|
|
|
7
7
|
* @author Lea Verou <https://lea.verou.me>
|
|
8
8
|
* @namespace
|
|
9
9
|
* @public
|
|
10
|
-
*/function tu(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}"undefined"!=typeof module&&module.exports&&(module.exports=eu),"undefined"!=typeof global&&(global.Prism=eu),eu.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},eu.languages.markup.tag.inside["attr-value"].inside.entity=eu.languages.markup.entity,eu.languages.markup.doctype.inside["internal-subset"].inside=eu.languages.markup,eu.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(eu.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:eu.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:eu.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},eu.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(eu.languages.markup.tag,"addAttribute",{value:function(e,t){eu.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:eu.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),eu.languages.html=eu.languages.markup,eu.languages.mathml=eu.languages.markup,eu.languages.svg=eu.languages.markup,eu.languages.xml=eu.languages.extend("markup",{}),eu.languages.ssml=eu.languages.xml,eu.languages.atom=eu.languages.xml,eu.languages.rss=eu.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(eu),eu.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},eu.languages.javascript=eu.languages.extend("clike",{"class-name":[eu.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),eu.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,eu.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:eu.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:eu.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:eu.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:eu.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:eu.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),eu.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:eu.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),eu.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),eu.languages.markup&&(eu.languages.markup.tag.addInlined("script","javascript"),eu.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),eu.languages.js=eu.languages.javascript,function(){if(void 0!==eu&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",r="loaded",i="pre[data-src]:not(["+t+'="'+r+'"]):not(['+t+'="'+n+'"])';eu.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),eu.hooks.add("before-sanity-check",(function(s){var o=s.element;if(o.matches(i)){s.code="",o.setAttribute(t,n);var a=o.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=o.getAttribute("data-src"),c=s.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}eu.util.setLanguage(a,c),eu.util.setLanguage(o,c);var d=eu.plugins.autoloader;d&&d.loadLanguages(c),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(l,(function(e){o.setAttribute(t,r);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var i=e.split(/\r\n?|\n/g),s=n[0],l=null==n[1]?i.length:n[1];s<0&&(s+=i.length),s=Math.max(0,Math.min(s-1,i.length)),l<0&&(l+=i.length),l=Math.max(0,Math.min(l,i.length)),e=i.slice(s,l).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(s+1))}a.textContent=e,eu.highlightElement(a)}),(function(e){o.setAttribute(t,"failed"),a.textContent=e}))}})),eu.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)eu.highlightElement(t)}};var s=!1;eu.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),eu.plugins.fileHighlight.highlight.apply(this,arguments)}}}(),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var s=i.content[1],o=i.content[3];if(s&&o&&"code-language"===s.type&&"code-block"===o.type&&"string"==typeof s.content){var a=s.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,l]:o.alias.push(l):o.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var s=t.classes[r],c=/language-(.+)/.exec(s);if(c){n=c[1];break}}var u=e.languages[n];if(u)t.content=e.highlight(function(e){var t=e.replace(o,"");return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=a[t];return r||e})),t}(t.content),u,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift})),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism);function nu(e,t){for(const n of e.childNodes){if(Bo(n)&&n.tagName===t)return!0;nu(n,t)}return!1}const ru="data-language",iu="data-highlight-language",su="data-theme";let ou=class e extends is{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");pl(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(ru,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(iu,n));const r=this.getTheme();r&&t.setAttribute(su,r);const i=this.getStyle();return i&&t.setAttribute("style",i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(ru,r):i&&t.removeAttribute(ru);const s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?s&&r?r!==i&&t.setAttribute(iu,r):t.removeAttribute(iu):s&&r&&t.setAttribute(iu,r);const o=this.__theme,a=e.__theme;o?o!==a&&t.setAttribute(su,o):a&&t.removeAttribute(su);const l=this.__style,c=e.__style;return l?l!==c&&t.setAttribute("style",l):c&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");pl(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(ru,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(iu,n));const r=this.getTheme();r&&t.setAttribute(su,r);const i=this.getStyle();return i&&t.setAttribute("style",i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||nu(e,"BR"))?{conversion:cu,priority:1}:null,div:()=>({conversion:uu,priority:1}),pre:()=>({conversion:cu,priority:0}),table:e=>pu(e)?{conversion:du,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&pu(n)?{conversion:hu,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&pu(t)?{conversion:hu,priority:3}:null}}}static importJSON(e){return au().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const e=_s();return this.insertAfter(e,t),e}const{anchor:i,focus:s}=e,o=(i.isBefore(s)?i:s).getNode();if(Jr(o)){let e=xu(o);const t=[];for(;;)if(Qr(e))t.push(Xr()),e=e.getNextSibling();else{if(!_u(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(yu(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const n=o.splitText(i.offset)[0],r=0===i.offset?0:1,s=n.getIndexWithinParent()+r,a=o.getParentOrThrow(),l=[Lr(),...t];a.splice(s,0,l);const c=t[t.length-1];c?c.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(lu(o)){const{offset:t}=e.anchor;o.splice(t,0,[Lr()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=_s();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function au(e,t){return function(e){const t=qo();return $i(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}(ou).setLanguage(e).setTheme(t)}function lu(e){return e instanceof ou}function cu(e){return{node:au(e.getAttribute(ru))}}function uu(e){const t=e,n=gu(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(gu(t))return!0;t=t.parentElement}return!1}(t)?{node:n?au():null}:{node:null}}function du(){return{node:au()}}function hu(){return{node:null}}function gu(e){return null!==e.style.fontFamily.match("monospace")}function pu(e){return e.classList.contains("js-file-line-container")}let fu=class e extends Br{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return pl(t,mu(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=mu(n.theme,e.__highlightType),s=mu(n.theme,this.__highlightType);return i!==s&&(i&&fl(t,i),s&&pl(t,s)),r}static importJSON(e){return yu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return au()}};function mu(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function yu(e="",t){return Io(new fu(e,t))}function _u(e){return e instanceof fu}function bu(e,t){let n=e;for(let r=fa(e,t);r&&(_u(r.origin)||Qr(r.origin));r=ml(r))n=r.origin;return n}function xu(e){return bu(e,"previous")}function ku(e){return bu(e,"next")}!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const vu=globalThis.Prism||window.Prism,Su={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},wu={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Cu(e){return wu[e]||e}function Eu(e){return"string"==typeof e?e:Array.isArray(e)?e.map(Eu).join(""):Eu(e.content)}function Tu(e,t){const n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent();let i=vu.tokenize(r,vu.languages[n?"diff":t]);return n&&(i=function(e,t){const n=t,r=vu.languages[n],i={tokens:e},s=vu.languages.diff.PREFIXES;for(const e of i.tokens){if("string"==typeof e||!(e.type in s)||!Array.isArray(e.content))continue;const t=e.type;let n=0;const i=()=>(n++,new vu.Token("prefix",s[t],t.replace(/^(\w+).*/,"$1"))),o=e.content.filter((e=>"string"==typeof e||"prefix"!==e.type)),a=e.content.length-o.length,l=vu.tokenize(Eu(o),r);l.unshift(i());const c=/\r\n|\n/g,u=e=>{const t=[];c.lastIndex=0;let r,s=0;for(;n<a&&(r=c.exec(e));){const n=r.index+r[0].length;t.push(e.slice(s,n)),s=n,t.push(i())}if(0!==t.length)return s<e.length&&t.push(e.slice(s)),t},d=e=>{for(let t=0;t<e.length&&n<a;t++){const n=e[t];if("string"==typeof n){const r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if("string"==typeof n.content){const e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?d(n.content):d([n.content])}};d(l),n<a&&l.push(i()),e.content=l}return i.tokens}(i,n[1])),Nu(i)}function Nu(e,t){const n=[];for(const r of e)if("string"==typeof r){const e=r.split(/(\n|\t)/),i=e.length;for(let r=0;r<i;r++){const i=e[r];"\n"===i||"\r\n"===i?n.push(Lr()):"\t"===i?n.push(Xr()):i.length>0&&n.push(yu(i,t))}}else{const{content:e,alias:t}=r;"string"==typeof e?n.push(...Nu([e],"prefix"===r.type&&"string"==typeof t?t:r.type)):Array.isArray(e)&&n.push(...Nu(e,"unchanged"===r.type?void 0:r.type))}return n}const Au={$tokenize(e,t){return Tu(e,t||this.defaultLanguage)},defaultLanguage:"javascript",tokenize(e,t){return vu.tokenize(e,vu.languages[t||""]||vu.languages[this.defaultLanguage])}};function Lu(e,t,n){const r=e.getParent();lu(r)?Iu(r,t,n):_u(e)&&e.replace(Vr(e.__text))}function Pu(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let s="1",o=1;for(let e=0;e<i;e++)Pr(r[e])&&(s+="\n"+ ++o);n.setAttribute("data-gutter",s)}const Ou=new Set;function Iu(e,t,n){const r=e.getKey();void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage);if(!function(e){const t=function(e){const t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e),n=t||e;try{return!!n&&vu.languages.hasOwnProperty(n)}catch(e){return!1}}(e.getLanguage()||n.defaultLanguage))return e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!1),void async function(){}();e.getIsSyntaxHighlightSupported()||e.setIsSyntaxHighlightSupported(!0),Ou.has(r)||(Ou.add(r),t.update((()=>{!function(e,t){const n=Vs(e);if(!lu(n)||!n.isAttached())return;const r=vi();if(!si(r))return void t();const i=r.anchor,s=i.offset,o="element"===i.type&&Pr(n.getChildAtIndex(i.offset-1));let a=0;if(!o){const e=i.getNode();a=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(o?i.getNode().select(s,s):n.getChildren().some((e=>{const t=Jr(e);if(t||Pr(e)){const n=e.getTextContentSize();if(t&&n>=a)return e.select(a,a),!0;a-=n}return!1})))}(r,(()=>{const t=Vs(r);if(!lu(t)||!t.isAttached())return!1;const i=t.getLanguage()||n.defaultLanguage,s=n.$tokenize(t,i),o=function(e,t){let n=0;for(;n<e.length&&Fu(e[n],t[n]);)n++;const r=e.length,i=t.length,s=Math.min(r,i)-n;let o=0;for(;o<s;)if(o++,!Fu(e[r-o],t[i-o])){o--;break}const a=r-o;return{from:n,nodesForReplacement:t.slice(n,i-o),to:a}}(t.getChildren(),s),{from:a,to:l,nodesForReplacement:c}=o;return!(a===l&&!c.length||(e.splice(a,l-a,c),0))}))}),{onUpdate:()=>{Ou.delete(r)},skipTransforms:!0}))}function Fu(e,t){return _u(e)&&_u(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Qr(e)&&Qr(t)||Pr(e)&&Pr(t)}function Ru(e){if(!si(e))return!1;const t=e.anchor.getNode(),n=lu(t)?t:t.getParent(),r=e.focus.getNode(),i=lu(r)?r:r.getParent();return lu(n)&&n.is(i)}function Du(e){const t=e.getNodes(),n=[];if(1===t.length&&lu(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];_u(i)||Qr(i)||Pr(i)||tu(169),Pr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=ti(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function Mu(e){const t=vi();if(!si(t)||!Ru(t))return!1;const n=Du(t),r=n.length;if(0===r&&t.isCollapsed())return e===En&&t.insertNodes([Xr()]),!0;if(0===r&&e===En&&"\n"===t.getTextContent()){const e=Xr(),n=Lr(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),Ia(Wa(wa(ma(e,"next",0),$a(fa(n,"next"))),r)),!0}for(let i=0;i<r;i++){const r=n[i];if(r.length>0){let n=r[0];if(0===i&&(n=xu(n)),e===En){const e=Xr();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=ti(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Qr(n)&&n.remove()}}return!0}function zu(e,t){const n=vi();if(!si(n))return!1;const{anchor:r,focus:i}=n,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),c=e===yn;if(!Ru(n)||!_u(a)&&!Qr(a)||!_u(l)&&!Qr(l))return!1;if(!t.altKey){if(n.isCollapsed()){const e=a.getParentOrThrow();if(c&&0===s&&null===a.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!c&&s===a.getTextContentSize()&&null===a.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(a.isBefore(l)?(u=xu(a),d=ku(l)):(u=xu(l),d=ku(a)),null==u||null==d)return!1;const h=u.getNodesBetween(d);for(let e=0;e<h.length;e++){const t=h[e];if(!_u(t)&&!Qr(t)&&!Pr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!Pr(g))return!0;const p=c?g.getPreviousSibling():g.getNextSibling();if(null==p)return!0;const f=_u(p)||Qr(p)||Pr(p)?c?xu(p):ku(p):null;let m=null!=f?f:p;return g.remove(),h.forEach((e=>e.remove())),e===yn?(h.forEach((e=>m.insertBefore(e))),m.insertBefore(g)):(m.insertAfter(g),m=g,h.forEach((e=>{m.insertAfter(e),m=e}))),n.setTextNodeRange(a,s,l,o),!0}function Bu(e,t){const n=vi();if(!si(n))return!1;const{anchor:r,focus:i}=n,s=r.getNode(),o=i.getNode(),a=e===mn;if(!Ru(n)||!_u(s)&&!Qr(s)||!_u(o)&&!Qr(o))return!1;const l=o;if("rtl"===function(e){const t=xu(e),n=ku(e);let r=t;for(;null!==r;){if(_u(r)){const e=Ds(r.getTextContent());if(null!==e)return e}if(r===n)break;r=r.getNextSibling()}const i=t.getParent();if(ss(i)){const e=i.getDirection();if("ltr"===e||"rtl"===e)return e}return null}(l)?!a:a){const e=function(e,t){let n=null,r=null,i=e,s=t,o=e.getTextContent();for(;;){if(0===s){if(i=i.getPreviousSibling(),null===i)break;if(_u(i)||Qr(i)||Pr(i)||tu(167),Pr(i)){n={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const e=o[s];_u(i)&&" "!==e&&(r={node:i,offset:s})}if(null!==r)return r;let a=null;if(t<e.getTextContentSize())_u(e)&&(a=e.getTextContent()[t]);else{const t=e.getNextSibling();_u(t)&&(a=t.getTextContent()[0])}if(null!==a&&" "!==a)return n;{const r=function(e,t){let n=e,r=t,i=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!_u(n)||r===s){if(n=n.getNextSibling(),null===n||Pr(n))return null;_u(n)&&(r=0,i=n.getTextContent(),s=n.getTextContentSize())}if(_u(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}(l,i.offset);if(null!==e){const{node:t,offset:r}=e;Pr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else l.getParentOrThrow().selectStart()}else(function(e){const t=ku(e);return Pr(t)&&tu(168),t})(l).select();return t.preventDefault(),t.stopPropagation(),!0}const $u=new Set(["http:","https:","mailto:","sms:","tel:"]);let Uu=class e extends is{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:s=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=s}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),pl(t,e.theme.link),t}updateLinkDOM(e,t,n){if(zo(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const n of["target","rel","title"]){const r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:Hu,priority:1})}}static importJSON(e){return Wu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Yu(e);try{const t=new URL(Yu(e));if(!$u.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=Wu(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!si(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function Hu(e){let t=null;if(zo(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=Wu(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Wu(e="",t){return Io(new Uu(e,t))}function Ku(e){return e instanceof Uu}class qu extends Uu{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new qu(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return ju().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(ss(n)){const e=ju(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}}function ju(e="",t){return Io(new qu(e,t))}function Gu(e){return e instanceof qu}function Vu(e,t){if("element"===e.type){const n=e.getNode();return ss(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Ju(e,t={}){let n;if(e&&"object"==typeof e){const{url:r,...i}=e;n=r,t={...i,...t}}else n=e;const{target:r,title:i}=t,s=void 0===t.rel?"noreferrer":t.rel,o=vi();if(null===o||!si(o)&&!ai(o))return;if(ai(o)){const e=o.getNodes();if(0===e.length)return;return void e.forEach((e=>{if(null===n){const t=ea(e,(e=>!Gu(e)&&Ku(e)));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=ea(e,(e=>!Gu(e)&&Ku(e)));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==s&&t.setRel(s);else{const t=Wu(n,{rel:s,target:r});e.insertBefore(t),t.append(e)}}}))}const a=o.extract();if(null===n){const e=new Set;return void a.forEach((t=>{const n=t.getParent();if(Ku(n)&&!Gu(n)){const t=n.getKey();if(e.has(t))return;!function(e,t){const n=new Set(t.filter((t=>e.isParentOf(t))).map((e=>e.getKey()))),r=e.getChildren(),i=r.filter((e=>n.has(e.getKey())));if(i.length===r.length)return r.forEach((t=>e.insertBefore(t))),void e.remove();const s=r.findIndex((e=>n.has(e.getKey()))),o=r.findLastIndex((e=>n.has(e.getKey()))),a=0===s,l=o===r.length-1;if(a)i.forEach((t=>e.insertBefore(t)));else if(l)for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);else{for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);const t=r.slice(o+1);if(t.length>0){const n=Wu(e.getURL(),{rel:e.getRel(),target:e.getTarget(),title:e.getTitle()});i[i.length-1].insertAfter(n),t.forEach((e=>n.append(e)))}}}(n,a),e.add(t)}}))}const l=new Set,c=e=>{l.has(e.getKey())||(l.add(e.getKey()),e.setURL(n),void 0!==r&&e.setTarget(r),void 0!==s&&e.setRel(s),void 0!==i&&e.setTitle(i))};if(1===a.length){const e=a[0],t=ea(e,Ku);if(null!==t)return c(t)}!function(e){const t=vi();if(!si(t))return e();const n=ft(t),r=n.isBackward(),i=Vu(n.anchor,r?-1:0),s=Vu(n.focus,r?0:-1);if(e(),i||s){const e=vi();if(si(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(s){const e=s.getParent();e&&t.focus.set(e.getKey(),s.getIndexWithinParent()+(r?0:1),"element")}no(ft(t))}}}((()=>{let e=null;for(const t of a){if(!t.isAttached())continue;const o=ea(t,Ku);if(o){c(o);continue}if(ss(t)){if(!t.isInline())continue;if(Ku(t)){if(!(Gu(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(const e of t.getChildren())t.insertBefore(e);t.remove();continue}}const a=t.getPreviousSibling();Ku(a)&&a.is(e)?a.append(t):(e=Wu(n,{rel:s,target:r,title:i}),t.insertAfter(e),e.append(t))}}))}const Zu=/^\+?[0-9\s()-]{5,}$/;function Yu(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Zu.test(e)?`tel:${e}`:`https://${e}`}function Xu(e){let t=e;for(;null!==t;){if(ic(t))return t;t=t.getParent()}return null}function Qu(e){let t=e;for(;t;){if(dc(t))return t.getListType();t=t.getParent()}return null}function ed(e,t=e=>e){return td(Br,e,((e,n)=>({...e,forChild:(r,i)=>{const s=e?.forChild??(e=>e);let o=s(r,i);return Jr(o)&&(o=t(o,n)??o),o}})))}function td(e,t,n=e=>e){return r=>{const i=e.importDOM()?.[t]?.(r);if(!i)return null;const s=i.conversion(r);return s?n(s,r)??s:s}}function nd(e){const t="string"==typeof e?ja(e):e;return!(!t.color&&!t["background-color"])}class rd extends HTMLElement{constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar"}connectedCallback(){requestAnimationFrame((()=>this.#e())),this._resizeObserver=new ResizeObserver((()=>this.#e())),this._resizeObserver.observe(this)}disconnectedCallback(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}setEditor(e){this.editorElement=e,this.editor=e.editor,this.#t(),this.#n(),this.#r(),this.#i(),this.#s(),this.#e(),this.toggleAttribute("connected",!0)}get#o(){const e=this.querySelectorAll("[data-dialog-target]"),t=Array.from(e).map((e=>`lexxy-${e.dataset.dialogTarget}`));return Array.from(this.querySelectorAll(t))}#t(){this.addEventListener("click",this.#a.bind(this))}#a({target:e}){this.#l(e,"[data-command]",this.#c.bind(this)),this.#l(e,"[data-dialog-target]",this.#u.bind(this))}#l(e,t,n){const r=e.closest(t);r&&n(r)}#c(e){const{command:t,payload:n}=e.dataset;this.editor.dispatchCommand(t,n)}#u(e){const t=e.dataset.dialogTarget,n=this.querySelector("lexxy-"+t);n&&(n.open?n.close():(this.#d(),n.show(e)))}#d(){this.querySelectorAll("dialog[open]").forEach((e=>{e.closest(".lexxy-dialog").close()}))}#n(){this.editorElement.addEventListener("keydown",(e=>{this.querySelectorAll("[data-hotkey]").forEach((t=>{t.dataset.hotkey.toLowerCase().split(/\s+/).includes(this.#h(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))}))}#h(e){const t=e.key.toLowerCase();return[...[e.ctrlKey?"ctrl":null,e.metaKey?"cmd":null,e.altKey?"alt":null,e.shiftKey?"shift":null].filter(Boolean),t].join("+")}#r(){const e=parseInt(this.editorElement.editorContentElement.getAttribute("tabindex")??"0");this.#g.forEach(((t,n)=>{t.setAttribute("tabindex",`${e+n+1}`)}))}#i(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{this.#p(),this.#f()}))}))}#s(){this.editor.registerUpdateListener((()=>{this.#m()}))}#m(){this.editor.getEditorState().read((()=>{const e=this.editorElement.historyState;e&&(this.#y("undo",0===e.undoStack.length),this.#y("redo",0===e.redoStack.length))}))}#p(){const e=vi();if(!si(e))return;const t=e.anchor.getNode();if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e.hasFormat("bold"),i=e.hasFormat("italic"),s=e.hasFormat("strikethrough"),o=function(e){return!!si(e)&&(e.isCollapsed()?nd(e.style):e.hasFormat("highlight"))}(e),a=this.#_(t),l=Hc(n),c=Vc(n),u=lu(n)||e.hasFormat("code"),d=this.#b(t),h=Qu(t);this.#x("bold",r),this.#x("italic",i),this.#x("strikethrough",s),this.#x("highlight",o),this.#x("link",a),this.#x("quote",l),this.#x("heading",c),this.#x("code",u),this.#x("unordered-list",d&&"bullet"===h),this.#x("ordered-list",d&&"number"===h),this.#m()}#f(){this.#o.forEach((e=>e.updateStateCallback()))}#b(e){let t=e;for(;t;){if(dc(t)||ic(t))return!0;t=t.getParent()}return!1}#_(e){let t=e;for(;t;){if(Ku(t))return!0;t=t.getParent()}return!1}#x(e,t){const n=this.querySelector(`[name="${e}"]`);n&&n.setAttribute("aria-pressed",t.toString())}#y(e,t){const n=this.querySelector(`[name="${e}"]`);n&&(n.disabled=t,n.setAttribute("aria-disabled",t.toString()))}#k(){return this.scrollWidth>this.clientWidth}#e=()=>{this.#v(),this.#S(),this.#w.style.display=this.#C.children.length?"block":"none",this.#w.setAttribute("nonce",cl());const e=this.#C.children.length>0;this.toggleAttribute("overflowing",e)};get#w(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#C(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")}#v(){for(;this.#C.children.length>0;)this.insertBefore(this.#C.children[0],this.#w)}#S(){const e=this.#E.reverse();let t=!1;for(const n of e){if(!this.#k()){t&&this.#C.prepend(n);break}this.#C.prepend(n),t=!0}}get#g(){return Array.from(this.querySelectorAll(":scope > button"))}get#E(){return Array.from(this.querySelectorAll(":scope > button, :scope > [role=separator]"))}static get defaultTemplate(){return'\n <button class="lexxy-editor__toolbar-button" type="button" name="bold" data-command="bold" title="Bold">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 22V2h8.183c1.764 0 3.174.435 4.228 1.304 1.055.87 1.582 2.076 1.582 3.62 0 .8-.148 1.503-.445 2.109a3.94 3.94 0 01-1.194 1.465 4.866 4.866 0 01-1.726.806v.176c.786.078 1.51.312 2.172.703a4.293 4.293 0 011.596 1.627c.403.693.604 1.543.604 2.549 0 1.192-.292 2.207-.877 3.048-.585.84-1.39 1.484-2.416 1.934-1.026.44-2.206.659-3.538.659H5zM8.854 4.974v5.348h2.56c.873 0 1.582-.107 2.129-.322.556-.215.963-.523 1.222-.923.269-.41.403-.904.403-1.48 0-.82-.254-1.46-.762-1.92-.499-.468-1.204-.703-2.115-.703H8.854zm0 8.103v5.949h2.877c1.534 0 2.636-.245 3.307-.733.671-.498 1.007-1.221 1.007-2.168 0-.635-.134-1.178-.403-1.627-.268-.459-.666-.81-1.193-1.055-.518-.244-1.156-.366-1.913-.366H8.854z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="italic" data-command="italic" title="Italic">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.1 4h-1.5l-3.2 16h1.5l-.4 2h-7l.4-2h1.5l3.2-16h-1.5l.4-2h7l-.4 2z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="strikethrough" data-command="strikethrough" title="Strikethrough">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.70588 16.1591C4.81459 19.7901 7.48035 22 11.6668 22C15.9854 22 18.724 19.6296 18.724 15.8779C18.724 15.5007 18.6993 15.1427 18.6474 14.8066H14.3721C14.8637 15.2085 15.0799 15.7037 15.0799 16.3471C15.0799 17.7668 13.7532 18.7984 11.8113 18.7984C9.88053 18.7984 8.38582 17.7531 8.21659 16.1591H4.70588ZM5.23953 9.31962H9.88794C9.10723 8.88889 8.75888 8.33882 8.75888 7.57339C8.75888 6.13992 9.96576 5.18793 11.7631 5.18793C13.5852 5.18793 14.8761 6.1797 14.9959 7.81344H18.4102C18.3485 4.31824 15.8038 2 11.752 2C7.867 2 5.09129 4.35802 5.09129 7.92044C5.09129 8.41838 5.14071 8.88477 5.23953 9.31962ZM2.23529 10.6914C1.90767 10.6914 1.59347 10.8359 1.36181 11.0931C1.13015 11.3504 1 11.6993 1 12.0631C1 12.4269 1.13015 12.7758 1.36181 13.0331C1.59347 13.2903 1.90767 13.4348 2.23529 13.4348H20.7647C21.0923 13.4348 21.4065 13.2903 21.6382 13.0331C21.8699 12.7758 22 12.4269 22 12.0631C22 11.6993 21.8699 11.3504 21.6382 11.0931C21.4065 10.8359 21.0923 10.6914 20.7647 10.6914H2.23529Z"/>\n </svg>\n </button>\n\n <lexxy-highlight-dialog class="lexxy-dialog lexxy-highlight-dialog">\n <dialog class="highlight-dialog">\n <div class="lexxy-highlight-dialog-content">\n <div data-button-group="color" data-values="var(--highlight-1); var(--highlight-2); var(--highlight-3); var(--highlight-4); var(--highlight-5); var(--highlight-6); var(--highlight-7); var(--highlight-8); var(--highlight-9)"></div>\n <div data-button-group="background-color" data-values="var(--highlight-bg-1); var(--highlight-bg-2); var(--highlight-bg-3); var(--highlight-bg-4); var(--highlight-bg-5); var(--highlight-bg-6); var(--highlight-bg-7); var(--highlight-bg-8); var(--highlight-bg-9)"></div>\n <button data-command="removeHighlight" class="lexxy-highlight-dialog-reset">Remove all coloring</button>\n </div>\n </dialog>\n </lexxy-highlight-dialog>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="highlight" title="Color highlight" data-dialog-target="highlight-dialog">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.65422 0.711575C7.1856 0.242951 6.42579 0.242951 5.95717 0.711575C5.48853 1.18021 5.48853 1.94 5.95717 2.40864L8.70864 5.16011L2.85422 11.0145C1.44834 12.4204 1.44833 14.6998 2.85422 16.1057L7.86011 21.1115C9.26599 22.5174 11.5454 22.5174 12.9513 21.1115L19.6542 14.4087C20.1228 13.94 20.1228 13.1802 19.6542 12.7115L11.8544 4.91171L11.2542 4.31158L7.65422 0.711575ZM4.55127 12.7115L10.4057 6.85716L17.1087 13.56H4.19981C4.19981 13.253 4.31696 12.9459 4.55127 12.7115ZM23.6057 20.76C23.6057 22.0856 22.5311 23.16 21.2057 23.16C19.8802 23.16 18.8057 22.0856 18.8057 20.76C18.8057 19.5408 19.8212 18.5339 20.918 17.4462C21.0135 17.3516 21.1096 17.2563 21.2057 17.16C21.3018 17.2563 21.398 17.3516 21.4935 17.4462C22.5903 18.5339 23.6057 19.5408 23.6057 20.76Z"/></svg>\n </button>\n\n <lexxy-link-dialog class="lexxy-dialog lexxy-link-dialog">\n <dialog class="link-dialog">\n <form method="dialog">\n <input type="url" placeholder="Enter a URL…" class="input" required>\n <div class="lexxy-dialog-actions">\n <button type="submit" class="btn" value="link">Link</button>\n <button type="button" class="btn" value="unlink">Unlink</button>\n </div>\n </form>\n </dialog>\n </lexxy-link-dialog>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="link" title="Link" data-dialog-target="link-dialog" data-hotkey="cmd+k ctrl+k">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.111 9.546a1.5 1.5 0 012.121 0 5.5 5.5 0 010 7.778l-2.828 2.828a5.5 5.5 0 01-7.778 0 5.498 5.498 0 010-7.777l2.828-2.83a1.5 1.5 0 01.355-.262 6.52 6.52 0 00.351 3.799l-1.413 1.414a2.499 2.499 0 000 3.535 2.499 2.499 0 003.535 0l2.83-2.828a2.5 2.5 0 000-3.536 1.5 1.5 0 010-2.121z"/><path d="M12.111 3.89a5.5 5.5 0 117.778 7.777l-2.828 2.829a1.496 1.496 0 01-.355.262 6.522 6.522 0 00-.351-3.8l1.413-1.412a2.5 2.5 0 10-3.536-3.535l-2.828 2.828a2.5 2.5 0 000 3.536 1.5 1.5 0 01-2.122 2.12 5.5 5.5 0 010-7.777l2.83-2.829z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="quote" data-command="insertQuoteBlock" title="Quote">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.5 5C8.985 5 11 7.09 11 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.022.746a.563.563 0 01-.52-.36.602.602 0 01.067-.57l.055-.066.009-.009.041-.048a4.25 4.25 0 00.168-.21c.143-.188.336-.47.53-.84a6.743 6.743 0 00.75-2.605C3.705 13.994 2 12.038 2 9.667 2 7.089 4.015 5 6.5 5zM17.5 5C19.985 5 22 7.09 22 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.023.746a.563.563 0 01-.52-.36.602.602 0 01.068-.57l.055-.066.009-.009.041-.048c.039-.045.097-.115.168-.21a6.16 6.16 0 00.53-.84 6.745 6.745 0 00.75-2.605C14.705 13.994 13 12.038 13 9.667 13 7.089 15.015 5 17.5 5z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="heading" data-command="rotateHeadingFormat" title="Heading">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M15.322 5.315H9.64V22H5.684V5.315H0v-3.31h15.322v3.31z"/><path d="M23.957 11.79H19.92V22h-3.402V11.79H12.48V9.137h11.477v2.653z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="code" data-command="insertCodeBlock" title="Code">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.121 6l-6 6 6 6-2.12 2.121-7.061-7.06a1.5 1.5 0 010-2.121L8 3.879 10.121 6zM23.06 10.94a1.5 1.5 0 010 2.12L16 20.121 13.88 18l6-6-6-6L16 3.879l7.06 7.06z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="unordered-list" data-command="insertUnorderedList" title="Bullet list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 5a2 2 0 11-4 0 2 2 0 014 0zM5 12a2 2 0 11-4 0 2 2 0 014 0zM5 19a2 2 0 11-4 0 2 2 0 014 0zM7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="ordered-list" data-command="insertOrderedList" title="Numbered list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM4.438 8H3.39V3.684H3.34c-.133.093-.267.188-.402.285l-.407.289a129.5 129.5 0 00-.402.285v-.969l.633-.453c.21-.15.42-.302.629-.453h1.046V8zM2.672 11.258h-1v-.051c0-.206.036-.405.11-.598.075-.195.188-.37.34-.527.15-.156.339-.281.566-.375.229-.094.498-.14.808-.14.367 0 .688.065.961.195s.484.308.633.535c.15.224.226.478.226.762 0 .244-.046.463-.14.656-.091.19-.209.368-.352.535-.14.164-.289.332-.445.504L3.168 14.09v.05h2.238V15H1.723v-.656l1.949-2.102c.096-.101.19-.207.281-.316.091-.112.167-.232.227-.36a.953.953 0 00.09-.41.712.712 0 00-.387-.648.845.845 0 00-.41-.098.81.81 0 00-.43.11.75.75 0 00-.277.293.824.824 0 00-.094.386V11.258zM2.852 19.66v-.812h.562a.917.917 0 00.43-.098.742.742 0 00.293-.266.673.673 0 00.101-.379.654.654 0 00-.234-.523.87.87 0 00-.59-.2.987.987 0 00-.336.055.837.837 0 00-.258.149.712.712 0 00-.172.215.66.66 0 00-.066.25h-.98c.007-.209.053-.403.136-.582.084-.18.203-.336.36-.469.156-.135.346-.24.57-.316.227-.076.486-.115.777-.118a2.33 2.33 0 01.965.176c.271.12.48.285.63.496.15.209.227.448.23.719a1.11 1.11 0 01-.16.637 1.28 1.28 0 01-.825.586v.054c.162.016.33.07.504.164.177.094.328.232.453.415.125.18.189.411.192.695a1.37 1.37 0 01-.157.676c-.104.197-.25.365-.437.503-.188.136-.404.24-.649.313-.242.07-.5.105-.777.105-.401 0-.743-.067-1.027-.203a1.608 1.608 0 01-.649-.547 1.46 1.46 0 01-.238-.75h.969c.01.128.057.243.14.344a.885.885 0 00.332.238c.141.058.3.088.477.09.195 0 .366-.034.512-.101a.798.798 0 00.336-.29.744.744 0 00.117-.425.74.74 0 00-.446-.695 1.082 1.082 0 00-.496-.106h-.59z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="upload" data-command="uploadAttachments" title="Upload file">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 8a2 2 0 110 4 2 2 0 010-4z""/><path d="M22 2a1 1 0 011 1v18a1 1 0 01-1 1H2a1 1 0 01-1-1V3a1 1 0 011-1h20zM3 18.714L9 11l5.25 6.75L17 15l4 4V4H3v14.714z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="divider" data-command="insertHorizontalDivider" title="Insert a divider">\n <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 12C0 11.4477 0.447715 11 1 11H23C23.5523 11 24 11.4477 24 12C24 12.5523 23.5523 13 23 13H1C0.447716 13 0 12.5523 0 12Z"/><path d="M4 5C4 3.89543 4.89543 3 6 3H18C19.1046 3 20 3.89543 20 5C20 6.10457 19.1046 7 18 7H6C4.89543 7 4 6.10457 4 5Z"/><path d="M4 19C4 17.8954 4.89543 17 6 17H18C19.1046 17 20 17.8954 20 19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19Z"/></svg>\n </button>\n \n <div class="lexxy-editor__toolbar-spacer" role="separator"></div>\n \n <button class="lexxy-editor__toolbar-button" type="button" name="undo" data-command="undo" title="Undo" data-hotkey="cmd+z ctrl+z">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5.64648 8.26531C7.93911 6.56386 10.7827 5.77629 13.624 6.05535C16.4655 6.33452 19.1018 7.66079 21.0195 9.77605C22.5839 11.5016 23.5799 13.6516 23.8936 15.9352C24.0115 16.7939 23.2974 17.4997 22.4307 17.4997C21.5641 17.4997 20.8766 16.7915 20.7148 15.9401C20.4295 14.4379 19.7348 13.0321 18.6943 11.8844C17.3 10.3464 15.3835 9.38139 13.3174 9.17839C11.2514 8.97546 9.18359 9.54856 7.5166 10.7858C6.38259 11.6275 5.48981 12.7361 4.90723 13.9997H8.5C9.3283 13.9997 9.99979 14.6714 10 15.4997C10 16.3281 9.32843 16.9997 8.5 16.9997H1.5C0.671573 16.9997 0 16.3281 0 15.4997V8.49968C0.000213656 7.67144 0.671705 6.99968 1.5 6.99968C2.3283 6.99968 2.99979 7.67144 3 8.49968V11.0212C3.7166 9.9704 4.60793 9.03613 5.64648 8.26531Z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="redo" data-command="redo" title="Redo" data-hotkey="cmd+shift+z ctrl+shift+z ctrl+y">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.2599 8.26531C15.9672 6.56386 13.1237 5.77629 10.2823 6.05535C7.4408 6.33452 4.80455 7.66079 2.88681 9.77605C1.32245 11.5016 0.326407 13.6516 0.0127834 15.9352C-0.105117 16.7939 0.608975 17.4997 1.47567 17.4997C2.34228 17.4997 3.02969 16.7915 3.19149 15.9401C3.47682 14.4379 4.17156 13.0321 5.212 11.8844C6.60637 10.3464 8.52287 9.38139 10.589 9.17839C12.655 8.97546 14.7227 9.54856 16.3897 10.7858C17.5237 11.6275 18.4165 12.7361 18.9991 13.9997H15.4063C14.578 13.9997 13.9066 14.6714 13.9063 15.4997C13.9063 16.3281 14.5779 16.9997 15.4063 16.9997H22.4063C23.2348 16.9997 23.9063 16.3281 23.9063 15.4997V8.49968C23.9061 7.67144 23.2346 6.99968 22.4063 6.99968C21.578 6.99968 20.9066 7.67144 20.9063 8.49968V11.0212C20.1897 9.9704 19.2984 9.03613 18.2599 8.26531Z"/></svg>\n </button>\n\n <details class="lexxy-editor__toolbar-overflow">\n <summary class="lexxy-editor__toolbar-button" aria-label="Show more toolbar buttons">•••</summary>\n <div class="lexxy-editor__toolbar-overflow-menu" aria-label="More toolbar buttons"></div>\n </details>\n '}}function id(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}customElements.define("lexxy-toolbar",rd),function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism),function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:i,punctuation:s};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},a=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];e.languages.insertBefore("php","variable",{string:a,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:a,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:i,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){if(/<\?/.test(t.code)){e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(Prism),Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"],function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],s=r.variable[1].inside,o=0;o<i.length;o++)s[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash}(Prism),Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const sd=/[!-/:-@[-`{-~\s]/;function od(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ad=function(e,t){return new et(e,t)}("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-"}),ld=e=>(t,n,r,i)=>{const s=e(r);s.append(...n),t.replace(s),i||s.select(0,0)},cd=e=>(t,n,r,i)=>{const s=t.getPreviousSibling(),o=t.getNextSibling(),a=rc("check"===e?"x"===r[3]:void 0),l=r[0].trim()[0],c="bullet"!==e&&"check"!==e||l!==ad.parse(l)?void 0:l;if(dc(o)&&o.getListType()===e){c&&nt(o,ad,c);const e=o.getFirstChild();null!==e?e.insertBefore(a):o.append(a),t.remove()}else if(dc(s)&&s.getListType()===e)c&&nt(s,ad,c),s.append(a),t.remove();else{const n=uc(e,"number"===e?Number(r[2]):void 0);c&&nt(n,ad,c),n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const u=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&a.setIndent(u)},ud=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const o of i)if(ic(o)){if(1===o.getChildrenSize()){const e=o.getFirstChild();if(dc(e)){r.push(ud(e,t,n+1));continue}}const i=" ".repeat(4*n),a=e.getListType(),l=tt(e,ad),c="number"===a?`${e.getStart()+s}. `:"check"===a?`${l} [${o.getChecked()?"x":" "}] `:l+" ";r.push(i+c+t(o)),s++}return r.join("\n")},dd={dependencies:[Wc],export:(e,t)=>{if(!Vc(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:ld((e=>Gc("h"+e[1].length))),type:"element"},hd={dependencies:[$c],export:(e,t)=>{if(!Hc(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(Hc(n))return n.splice(n.getChildrenSize(),0,[Lr(),...t]),void e.remove()}const i=Uc();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},gd={dependencies:[ou],export:e=>{if(!lu(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:/[ \t]*```$/},regExpStart:/^[ \t]*```([\w-]+)?/,replace:(e,t,n,r,i,s)=>{let o,a;if(!t&&i){if(1===i.length)r?(o=au(),a=n[1]+i[0]):(o=au(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=au(n[1]),0===i[0].trim().length)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();a=i.join("\n")}const t=Vr(a);o.append(t),e.append(o)}else t&&ld((e=>au(e?e[1]:void 0)))(e,t,n,s)},type:"multiline-element"},pd={dependencies:[sc,ec],export:(e,t)=>dc(e)?ud(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:cd("bullet"),type:"element"},fd={dependencies:[sc,ec],export:(e,t)=>dc(e)?ud(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:cd("number"),type:"element"},md={dependencies:[Uu],export:(e,t,n)=>{if(!Ku(e)||Gu(e))return null;const r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,i]=t,s=Wu(r,{title:i}),o=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(o<a)return;if(o>a){const e=n.split("[");c="["+e[0],l=e.slice(1).join("[")}const u=Vr(l);return u.setFormat(e.getFormat()),s.append(u),e.replace(s),c&&s.insertBefore(Vr(c)),u},trigger:")",type:"text-match"},yd=[...[dd,hd,pd,fd],...[gd],...[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],...[md]];function _d(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(bd(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function bd(e,t,n,r,i){for(let s=0;s<i;s++)if(e[t+s]!==n[r+s])return!1;return!0}function xd(e,t=yd){const n=function(e){const t=id(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}(t),r=id(n.textFormat,(({tag:e})=>e[e.length-1])),i=id(n.textMatch,(({trigger:e})=>e));for(const n of t){const t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=n.dependencies;for(const n of t)e.hasNode(n)||od(173,n.getType())}}const s=(e,t,s)=>{(function(e,t,n,r){if(!Oo(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExp:s,replace:o}of r){const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,!1))return s.remove(),!0}}return!1})(e,t,s,n.element)||function(e,t,n,r){if(!Oo(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExpStart:s,replace:o,regExpEnd:a}of r){if(a&&!("optional"in a)||a&&"optional"in a&&!a.optional)continue;const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,null,null,!1))return s.remove(),!0}}return!1}(e,t,s,n.multilineElement)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const t of i){if(!t.replace||!t.regExp)continue;const n=r.match(t.regExp);if(null===n)continue;const i=n.index||0,s=i+n[0].length;let o;return 0===i?[o]=e.splitText(s):[,o]=e.splitText(i,s),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,s,i)||function(e,t,n){const r=e.getTextContent(),i=t-1,s=r[i],o=n[s];if(!o)return!1;for(const t of o){const{tag:n}=t,o=n.length,a=i-o+1;if(o>1&&!bd(r,a,n,0,o))continue;if(" "===r[a-1])continue;const l=r[i+1];if(!1===t.intraword&&l&&!sd.test(l))continue;const c=e;let u=c,d=_d(r,a,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!Pr(h);)if(Jr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=_d(e,e.length,n)}if(d<0)continue;if(u===c&&d+o===a)continue;const g=u.getTextContent();if(d>0&&g[d-1]===s)continue;const p=g[d-1];if(!1===t.intraword&&p&&!sd.test(p))continue;const f=c.getTextContent(),m=f.slice(0,a)+f.slice(i+1);c.setTextContent(m);const y=u===c?m:g;u.setTextContent(y.slice(0,d)+y.slice(d+o));const _=vi(),b=bi();no(b);const x=i-o*(u===c?2:1)+1;b.anchor.set(u.__key,d,"text"),b.focus.set(c.__key,x,"text");for(const e of t.format)b.hasFormat(e)||b.formatText(e);b.anchor.set(b.focus.key,b.focus.offset,b.focus.type);for(const e of t.format)b.hasFormat(e)&&b.toggleFormat(e);return si(_)&&(b.format=_.format),!0}}(t,s,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(wr)||t.has(vr))return;if(e.isComposing())return;const o=r.read(vi),a=i.read(vi);if(!si(a)||!si(o)||!o.isCollapsed()||o.is(a))return;const l=o.anchor.key,c=o.anchor.offset,u=r._nodeMap.get(l);!Jr(u)||!n.has(l)||1!==c&&c>a.anchor.offset+1||e.update((()=>{if(!function(e){return Jr(e)&&!e.hasFormat("code")}(u))return;const e=u.getParent();null===e||lu(e)||s(e,u,o.anchor.offset)}))}))}function kd(e,t){let n=Date.now(),r=0;return(i,s,o,a,l,c)=>{const u=Date.now();if(c.has(vr))return r=0,n=u,2;const d=function(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const s=t._selection,o=e._selection;if(i)return 1;if(!(si(s)&&si(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const e of t){const t=r.get(e);void 0!==t&&i.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||us(n)||i.push(n)}return i}(t,n,r);if(0===a.length)return 0;if(a.length>1){const n=t._nodeMap,r=n.get(s.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Jr(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Jr(c)||!Jr(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=s.anchor,g=o.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,f=g.offset,m=d.length-u.length;return 1===m&&f===p-1?2:-1===m&&f===p+1?3:-1===m&&f===p?4:0}(i,s,a,l,e.isComposing()),h=(()=>{const h=null===o||o.editor===e,g=c.has("history-push");if(!g&&h&&c.has(Sr))return 0;if(null===i)return 1;const p=s._selection;if(!(a.size>0||l.size>0))return null!==p?0:2;const f="number"==typeof t?t:t.peek();return!1===g&&0!==d&&d===r&&u<n+f&&h||1===a.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),s=t._selection,o=n._selection;return!(si(s)&&si(o)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===o.anchor.type&&"text"===o.focus.type||!Jr(r)||!Jr(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(a)[0],i,s)?0:1})();return n=u,r=d,h}}function vd(e){e.undoStack=[],e.redoStack=[],e.current=null}function Sd(e,t,n){const r=kd(e,n),i=gl(e.registerCommand(un,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,s=r.pop();null!==i&&(n.push(i),e.dispatchCommand(zn,!0)),0===r.length&&e.dispatchCommand(Bn,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:vr})}}(e,t),!0)),0),e.registerCommand(dn,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(Bn,!0));const s=n.pop();0===n.length&&e.dispatchCommand(zn,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:vr})}}(e,t),!0)),0),e.registerCommand(Dn,(()=>(vd(t),!1)),0),e.registerCommand(Mn,(()=>(vd(t),e.dispatchCommand(zn,!1),e.dispatchCommand(Bn,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:s,dirtyElements:o,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(i,n,l,s,o,a);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(zn,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Bn,!0));else if(2===h)return;t.current={editor:e,editorState:n}})));return i}function wd(){return{current:null,redoStack:[],undoStack:[]}}var Cd={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",strikethrough:"lexxy-content__strikethrough",underline:"lexxy-content__underline",highlight:"lexxy-content__highlight"},list:{nested:{listitem:"lexxy-nested-listitem"}},codeHighlight:{addition:"code-token__selector",atrule:"code-token__attr",attr:"code-token__attr","attr-name":"code-token__attr","attr-value":"code-token__selector",boolean:"code-token__property",bold:"code-token__variable",builtin:"code-token__selector",cdata:"code-token__comment",char:"code-token__selector",class:"code-token__function","class-name":"code-token__function",color:"code-token__property",comment:"code-token__comment",constant:"code-token__property",coord:"code-token__comment",decorator:"code-token__function",deleted:"code-token__operator",deletion:"code-token__operator",directive:"code-token__attr","directive-hash":"code-token__property",doctype:"code-token__comment",entity:"code-token__operator",function:"code-token__function",hexcode:"code-token__property",important:"code-token__function",inserted:"code-token__selector",italic:"code-token__comment",keyword:"code-token__attr",line:"code-token__selector",namespace:"code-token__variable",number:"code-token__property",macro:"code-token__function",operator:"code-token__operator",parameter:"code-token__variable",prolog:"code-token__comment",property:"code-token__property",punctuation:"code-token__punctuation","raw-string":"code-token__operator",regex:"code-token__variable",script:"code-token__function",selector:"code-token__selector",string:"code-token__selector",style:"code-token__function",symbol:"code-token__property",tag:"code-token__property",title:"code-token__function","type-definition":"code-token__function",url:"code-token__operator",variable:"code-token__variable"}};function Ed(e,t){const n=document.createElement(e);for(const[e,r]of Object.entries(t||{}))e in n?n[e]=r:null!=r&&n.setAttribute(e,r);return n}function Td(e){return(new DOMParser).parseFromString(e,"text/html")}function Nd(e,t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(r)}function Ad(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function Ld(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function Pd(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(2)} ${["B","KB","MB","GB","TB","PB"][t]}`}class Od extends as{static getType(){return"action_text_attachment"}static clone(e){return new Od({...e},e.__key)}static importJSON(e){return new Od({...e})}static importDOM(){return{"action-text-attachment":e=>({conversion:()=>({node:new Od({sgid:e.getAttribute("sgid"),src:e.getAttribute("url"),previewable:e.getAttribute("previewable"),altText:e.getAttribute("alt"),caption:e.getAttribute("caption"),contentType:e.getAttribute("content-type"),fileName:e.getAttribute("filename"),fileSize:e.getAttribute("filesize"),width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),img:e=>({conversion:()=>({node:new Od({src:e.getAttribute("src"),caption:e.getAttribute("alt")||"",contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),video:e=>{const t=e.getAttribute("src")||e.querySelector("source")?.src,n=t?.split("/")?.pop(),r=e.querySelector("source")?.getAttribute("content-type")||"video/*";return{conversion:()=>({node:new Od({src:t,fileName:n,contentType:r})}),priority:1}}}}constructor({sgid:e,src:t,previewable:n,altText:r,caption:i,contentType:s,fileName:o,fileSize:a,width:l,height:c},u){super(u),this.sgid=e,this.src=t,this.previewable=n,this.altText=r||"",this.caption=i||"",this.contentType=s||"",this.fileName=o||"",this.fileSize=a,this.width=l,this.height=c}createDOM(){const e=this.createAttachmentFigure();return e.addEventListener("click",(t=>{this.#T(e)})),this.isPreviewableAttachment?(e.appendChild(this.#N()),e.appendChild(this.#A())):(e.appendChild(this.#L()),e.appendChild(this.#P())),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:Ed("action-text-attachment",{sgid:this.sgid,previewable:this.previewable||null,url:this.src,alt:this.altText,caption:this.caption,"content-type":this.contentType,filename:this.fileName,filesize:this.fileSize,width:this.width,height:this.height,presentation:"gallery"})}}exportJSON(){return{type:"action_text_attachment",version:1,sgid:this.sgid,src:this.src,previewable:this.previewable,altText:this.altText,caption:this.caption,contentType:this.contentType,fileName:this.fileName,fileSize:this.fileSize,width:this.width,height:this.height}}decorate(){return null}createAttachmentFigure(){return e=this.contentType,t=this.isPreviewableAttachment,n=this.fileName,Ed("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e});var e,t,n}get#O(){return(e=this.contentType).startsWith("image/")&&!e.includes("svg");var e}get isPreviewableAttachment(){return this.#O||this.previewable}#N(){return Ed("img",{src:this.src,alt:this.altText,...this.#I})}get#I(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#L(){return Ed("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#P(){const e=Ed("figcaption",{className:"attachment__caption"}),t=Ed("strong",{className:"attachment__name",textContent:this.caption||this.fileName});if(e.appendChild(t),this.fileSize){const t=Ed("span",{className:"attachment__size",textContent:Pd(this.fileSize)});e.appendChild(t)}return e}#T(e){Nd(e,"lexxy:internal:select-node",{key:this.getKey()})}#A(){const e=Ed("figcaption",{className:"attachment__caption"}),t=Ed("textarea",{value:this.caption,placeholder:this.fileName,rows:"1"});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",this.#F.bind(this)),t.addEventListener("keydown",this.#R.bind(this)),e.appendChild(t),e}#F(e){const t=e.target;t.placeholder=this.fileName,this.#D(t)}#D(e){Nd(e,"lexxy:internal:invalidate-node",{key:this.getKey(),values:{caption:e.value}})}#R(e){"Enter"===e.key&&(this.#D(e.target),Nd(e.target,"lexxy:internal:move-to-next-line"),e.preventDefault()),e.stopPropagation()}}class Id extends Od{static getType(){return"action_text_attachment_upload"}static clone(e){return new Id({...e},e.__key)}static importJSON(e){return new Id({...e})}constructor({file:e,uploadUrl:t,blobUrlTemplate:n,editor:r,progress:i},s){super({contentType:e.type},s),this.file=e,this.uploadUrl=t,this.blobUrlTemplate=n,this.src=null,this.editor=r,this.progress=i||0}createDOM(){const e=this.createAttachmentFigure();this.isPreviewableAttachment?e.appendChild(this.#N()):e.appendChild(this.#L()),e.appendChild(this.#M());const t=Ed("progress",{value:this.progress,max:100});return e.appendChild(t),this.#z(e).then((()=>this.#B(t,e))),e}exportDOM(){const e=document.createElement("img");return this.src&&(e.src=this.src),{element:e}}exportJSON(){return{type:"action_text_attachment_upload",version:1,progress:this.progress,uploadUrl:this.uploadUrl,blobUrlTemplate:this.blobUrlTemplate,...super.exportJSON()}}#N(){return Ed("img")}#L(){return Ed("span",{className:"attachment__icon",textContent:this.#$()})}#$(){return this.file.name.split(".").pop().toLowerCase()}#M(){const e=Ed("figcaption",{className:"attachment__caption"}),t=Ed("span",{className:"attachment__name",textContent:this.file.name||""}),n=Ed("span",{className:"attachment__size",textContent:Pd(this.file.size)});return e.appendChild(t),e.appendChild(n),e}#z(e){const t=e.querySelector("img");return t?async function(e,t){return new Promise((n=>{const r=new FileReader;t.addEventListener("load",(()=>{n(t)})),r.onload=e=>{t.src=e.target.result||null},r.readAsDataURL(e)}))}(this.file,t):Promise.resolve()}#B(t,n){const r=new e(this.file,this.uploadUrl,this);r.delegate={directUploadWillStoreFileWithXHR:e=>{e.upload.addEventListener("progress",(e=>{this.editor.update((()=>{t.value=Math.round(e.loaded/e.total*100)}))}))}},r.create(((e,t)=>{e?this.#U(n):this.#H(t,n).then((()=>{this.#W(n,t)}))}))}#U(e){e.innerHTML="",e.classList.add("attachment--error"),e.appendChild(Ed("div",{innerText:`Error uploading ${this.file?.name??"image"}`}))}async#W(e,t){this.editor.update((()=>{const n=e.querySelector("img"),r=this.blobUrlTemplate.replace(":signed_id",t.signed_id).replace(":filename",encodeURIComponent(t.filename)),i=Vs(this.getKey());i&&i.replace(new Od({sgid:t.attachable_sgid,src:t.previewable?t.url:r,altText:t.filename,contentType:t.content_type,fileName:t.filename,fileSize:t.byte_size,width:n?.naturalWidth,previewable:t.previewable,height:n?.naturalHeight}))}),{tag:Sr})}async#H(e,t){return e.previewable?new Promise((n=>{this.editor.update((()=>{const r=this.#N();r.addEventListener("load",(()=>{n()})),r.src=e.url,t.insertBefore(r,t.firstChild)}))})):Promise.resolve()}}class Fd extends as{static getType(){return"horizontal_divider"}static clone(e){return new Fd(e.__key)}static importJSON(e){return new Fd}static importDOM(){return{hr:e=>({conversion:()=>({node:new Fd}),priority:1})}}constructor(e){super(e)}createDOM(){const e=Ed("figure",{className:"horizontal-divider"}),t=Ed("hr");return e.addEventListener("click",(t=>{Nd(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.appendChild(t),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:Ed("hr")}}exportJSON(){return{type:"horizontal_divider",version:1}}decorate(){return null}}const Rd=["bold","italic","strikethrough","link","unlink","toggleHighlight","removeHighlight","rotateHeadingFormat","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","insertHorizontalDivider","uploadAttachments","undo","redo"];class Dd{static configureFor(e){new Dd(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.highlighter=e.highlighter,this.#K(),this.#q()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(cn,"bold")}dispatchItalic(){this.editor.dispatchCommand(cn,"italic")}dispatchStrikethrough(){this.editor.dispatchCommand(cn,"strikethrough")}dispatchToggleHighlight(e){this.highlighter.toggle(e)}dispatchRemoveHighlight(){this.highlighter.remove()}dispatchLink(e){this.editor.update((()=>{const t=vi();if(si(t))if(t.isCollapsed()){const n=ju(e),r=Vr(e);n.append(r),t.insertNodes([n])}else Ju(e)}))}dispatchUnlink(){this.#j(null)}dispatchInsertUnorderedList(){const e=vi();if(!e)return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"bullet"===Qu(t)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(gc,void 0)}dispatchInsertOrderedList(){const e=vi();if(!e)return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"number"===Qu(t)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(pc,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedNodes((e=>Hc(e)),(()=>Uc()))}dispatchInsertCodeBlock(){this.editor.update((()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(cn,"code"):this.contents.toggleNodeWrappingAllSelectedLines((e=>lu(e)),(()=>new ou("plain")))}))}dispatchInsertHorizontalDivider(){this.editor.update((()=>{this.contents.insertAtCursorEnsuringLineBelow(new Fd)})),this.editor.focus()}dispatchRotateHeadingFormat(){this.editor.update((()=>{const e=vi();if(!si(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow();let n="h2";if(Vc(t)){const e=t.getTag();n="h2"===e?"h3":"h3"===e?"h4":"h4"===e?null:"h2"}n?this.contents.insertNodeWrappingEachSelectedLine((()=>Gc(n))):this.contents.removeFormattingFromSelectedLines()}))}dispatchUploadAttachments(){const e=Ed("input",{type:"file",multiple:!0,style:"display: none;",onchange:({target:e})=>{const t=Array.from(e.files);if(t.length)for(const e of t)this.contents.uploadFile(e)}});this.editorElement.appendChild(e),e.click(),setTimeout((()=>e.remove()),1e3)}dispatchUndo(){this.editor.dispatchCommand(un,void 0)}dispatchRedo(){this.editor.dispatchCommand(dn,void 0)}#K(){for(const t of Rd){const n=`dispatch${e=t,e.charAt(0).toUpperCase()+e.slice(1)}`;this.#G(t,0,this[n].bind(this))}var e;this.#G(sn,1,this.dispatchPaste.bind(this))}#G(e,t,n){this.editor.registerCommand(e,n,t)}#j(e){this.editor.update((()=>{Ju(null===e?null:e)}))}#q(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.editor.getRootElement().addEventListener("dragover",this.#V.bind(this)),this.editor.getRootElement().addEventListener("drop",this.#J.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#Z.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#Y.bind(this)))}#Z(e){this.dragCounter++,1===this.dragCounter&&this.editor.getRootElement().classList.add("lexxy-editor--drag-over")}#Y(e){this.dragCounter--,0===this.dragCounter&&this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")}#V(e){e.preventDefault()}#J(e){e.preventDefault(),this.dragCounter=0,this.editor.getRootElement().classList.remove("lexxy-editor--drag-over");const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);if(n.length){for(const e of n)this.contents.uploadFile(e);this.editor.focus()}}}function Md(){return new Promise(requestAnimationFrame)}class zd{constructor(e){this.editorElement=e,this.editorContentElement=e.editorContentElement,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#X(),this.#Q(),this.#ee(),this.#te()}clear(){this.current=null}set current(e){ai(e)?this.editor.getEditorState().read((()=>{this._current=vi(),this.#ne()})):this.editor.update((()=>{this.#ne(),this._current=null}))}get current(){return this._current}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read((()=>{const t=this.#re();if(!t)return;const n=this.#ie(t);n&&(e=this.#se(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{eo().selectEnd()}))}selectedNodeWithOffset(){const e=vi();if(!e)return{node:null,offset:0};if(si(e))return{node:e.anchor.getNode(),offset:e.anchor.offset};if(ai(e)){const[t]=e.getNodes();return{node:t,offset:0}}return{node:null,offset:0}}preservingSelection(e){let t=null;this.editor.getEditorState().read((()=>{const e=vi();e&&si(e)&&(t={anchor:{key:e.anchor.key,offset:e.anchor.offset},focus:{key:e.focus.key,offset:e.focus.offset}})})),e(),t&&this.editor.update((()=>{const e=vi();e&&si(e)&&(e.anchor.set(t.anchor.key,t.anchor.offset,"text"),e.focus.set(t.focus.key,t.focus.offset,"text"))}))}get hasSelectedWordsInSingleLine(){const e=vi();if(!si(e))return!1;if(e.isCollapsed())return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.getTopLevelElement()!==n.getTopLevelElement())return!1;if(!t.getTopLevelElement())return!1;const r=e.getNodes();for(const e of r)if(Pr(e))return!1;return!0}get isInsideList(){const e=vi();if(!si(e))return!1;return null!==Xu(e.anchor.getNode())}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#oe();return e?Jr(e)?this.#ae(e,t):ss(e)?this.#le(e,t):this.#ce(e):null}get topLevelNodeAfterCursor(){const{anchorNode:e,offset:t}=this.#oe();return e?Jr(e)?this.#ue(e):ss(e)?this.#le(e,t):this.#ce(e):null}get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#oe();return e?Jr(e)?this.#de(e,t):ss(e)?this.#he(e,t):this.#ge(e):null}get topLevelNodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#oe();return e?Jr(e)?this.#pe(e):ss(e)?this.#he(e,t):this.#ge(e):null}get#fe(){return this.editorElement.contents}get#me(){if(this._currentlySelectedKeys)return this._currentlySelectedKeys;this._currentlySelectedKeys=new Set;const e=vi();if(e&&ai(e))for(const t of e.getNodes())this._currentlySelectedKeys.add(t.getKey());return this._currentlySelectedKeys}#Q(){this.editor.registerCommand(fn,this.#ye.bind(this),1),this.editor.registerCommand(gn,this.#_e.bind(this),1),this.editor.registerCommand(yn,this.#be.bind(this),1),this.editor.registerCommand(_n,this.#xe.bind(this),1),this.editor.registerCommand(Sn,this.#ke.bind(this),1),this.editor.registerCommand(kn,this.#ve.bind(this),1),this.editor.registerCommand(Yt,(()=>{this.current=vi()}),1)}#X(){this.editor.getRootElement().addEventListener("lexxy:internal:select-node",(async e=>{await Md();const{key:t}=e.detail;this.editor.update((()=>{const e=Vs(t);if(e){const t=xi();t.add(e.getKey()),no(t)}this.editor.focus()}))})),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",(e=>{this.#Se()}))}#ee(){this.editor.getRootElement().addEventListener("keydown",(e=>{(function(e){return!(e.ctrlKey||e.metaKey||e.altKey||e.key.length>1&&"Enter"!==e.key&&"Space"!==e.key||1!==e.key.length)})(e)&&this.editor.update((()=>{const t=vi();if(si(t)&&t.isCollapsed()){const n=t.anchor.getNode(),r=t.anchor.offset,i=this.#we(n,r),s=this.#Ce(n,r);if(i instanceof as&&!i.isInline())return e.preventDefault(),void this.#fe.createParagraphAfterNode(i,e.key);if(s instanceof as&&!s.isInline())return e.preventDefault(),void this.#fe.createParagraphBeforeNode(s,e.key)}}))}),!0)}#we(e,t){return Jr(e)&&0===t?e.getPreviousSibling():ss(e)&&t>0?e.getChildAtIndex(t-1):null}#Ce(e,t){return Jr(e)&&t===e.getTextContentSize()?e.getNextSibling():ss(e)?e.getChildAtIndex(t):null}#te(){this.editorContentElement.addEventListener("keydown",(e=>{if("ArrowUp"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.previousElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.previousElementSibling;n||e.preventDefault()}}if("ArrowDown"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.nextElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.nextElementSibling;n||e.preventDefault()}}}),!0)}#ne(){this.#Ee(),this.#Te(),this.previouslySelectedKeys=this.#me,this._currentlySelectedKeys=null}#Ee(){for(const e of this.previouslySelectedKeys)if(!this.#me.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#Te(){for(const e of this.#me)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#ye(){this.current?await this.#Ne((e=>e.selectPrevious())):this.#Ae(this.nodeBeforeCursor)}async#_e(){this.current?await this.#Ne((e=>e.selectNext(0,0))):this.#Ae(this.nodeAfterCursor)}async#be(){this.current?await this.#Ne((e=>e.selectPrevious())):this.#Ae(this.topLevelNodeBeforeCursor)}async#xe(){this.current?await this.#Ne((e=>e.selectNext(0,0))):this.#Ae(this.topLevelNodeAfterCursor)}async#Ne(e){await Md(),this.current&&this.editor.update((()=>{this.clear(),e(this.current.getNodes()[0]),this.editor.focus()}))}async#Se(){this.editor.update((()=>{const e=this.#Le();e&&this.#Pe(e)}))}#Le(){const e=vi();return e?ai(e)?this.#Oe(e):si(e)?this.#Ie(e):null:null}#Oe(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#Ie(e){return e.anchor.getNode().getTopLevelElement()}#Pe(e){const t=e.getNextSibling();t?t.selectStart():this.#Fe()}#Fe(){const e=eo(),t=_s();e.append(t),t.selectStart()}#Ae(e){e&&e instanceof as&&this.editor.update((()=>{const t=xi();t.add(e.getKey()),no(t)}))}#ke(){const e=this.nodeAfterCursor;return e instanceof as?(this.#Ae(e),!0):(this.#fe.deleteSelectedNodes(),!1)}#ve(){const e=this.nodeBeforeCursor;return e instanceof as?(this.#Ae(e),!0):(this.#fe.deleteSelectedNodes(),!1)}#re(){const e=vi();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#ie(e){let t=e.getBoundingClientRect();if(this.#Re(t)){const n=this.#De(e);t=n.getBoundingClientRect(),this.#Me(n),n.remove()}return t}#Re(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#De(e){const t=this.#ze();return e.insertNode(t),t}#ze(){const e=document.createElement("span");return e.textContent="",e.style.display="inline-block",e.style.width="1px",e.style.height="1em",e.style.lineHeight="normal",e.setAttribute("nonce",cl()),e}#Me(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#se(e,t){const n=this.editor.getRootElement().getBoundingClientRect(),r=e.left-n.left;let i=e.top-n.top;const s=this.#Be(t);return isNaN(s)||(i+=s),{x:r,y:i,fontSize:s}}#Be(e){const t=window.getSelection().anchorNode,n=this.#$e(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#$e(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#oe(){const e=vi();if(!si(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#ae(e,t){return t===e.getTextContentSize()?this.#ue(e):null}#ue(e){if(e.getNextSibling()instanceof as)return e.getNextSibling();const t=e.getParent();return t?t.getNextSibling():null}#le(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#ce(e)}#de(e,t){return 0===t?this.#pe(e):null}#pe(e){if(e.getPreviousSibling()instanceof as)return e.getPreviousSibling();return e.getParent().getPreviousSibling()}#he(e,t){return t>0?e.getChildAtIndex(t-1):this.#ge(e)}#ce(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#ge(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}}class Bd extends as{static getType(){return"custom_action_text_attachment"}static clone(e){return new Bd({...e},e.__key)}static importJSON(e){return new Bd({...e})}static importDOM(){return{"action-text-attachment":e=>{const t=e.getAttribute("content");return e.getAttribute("content")?{conversion:()=>{const n=[],r=e.previousSibling;return r&&r.nodeType===Node.TEXT_NODE&&/\s$/.test(r.textContent)&&n.push(Vr(" ")),n.push(new Bd({sgid:e.getAttribute("sgid"),innerHtml:JSON.parse(t),contentType:e.getAttribute("content-type")})),n.push(Vr(" ")),{node:n}},priority:2}:null}}}constructor({sgid:e,contentType:t,innerHtml:n},r){super(r),this.sgid=e,this.contentType=t||"application/vnd.actiontext.unknown",this.innerHtml=n}createDOM(){const e=Ed("action-text-attachment",{"content-type":this.contentType,"data-lexxy-decorator":!0});return e.addEventListener("click",(t=>{Nd(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.insertAdjacentHTML("beforeend",this.innerHtml),e}updateDOM(){return!0}isInline(){return!0}exportDOM(){return{element:Ed("action-text-attachment",{sgid:this.sgid,content:JSON.stringify(this.innerHtml),"content-type":this.contentType})}}exportJSON(){return{type:"custom_action_text_attachment",version:1,sgid:this.sgid,contentType:this.contentType,innerHtml:this.innerHtml}}decorate(){return null}}class $d{constructor(e){this.editorElement=e,this.editor=e.editor}monitor(){this.editor.registerCommand(bn,(e=>this.#Ue(e)),3)}#Ue(e){const t=vi();if(!si(t))return!1;const n=t.anchor.getNode();return!!this.#He(n)&&(this.#We(e,n)||this.#Ke(e,n))}#We(e,t){return!(!this.#qe(t)&&!this.#je(t))&&(e.preventDefault(),this.#Ge(t),!0)}#Ke(e,t){return!!this.#Ve(t)&&(e.preventDefault(),this.#Je(t),!0)}#He(e){let t=e;for(;t;){if(Hc(t))return!0;t=t.getParent()}return!1}#qe(e){const t=this.#Ze(e);return!!t&&this.#Ye(t)}#je(e){const t=this.#Xe(e);if(!t)return!1;if(!this.#Ye(t))return!1;const n=t.getParent();return n&&ic(n)}#Ye(e){if(""!==e.getTextContent().trim())return!1;const t=e.getChildren();return 0===t.length||t.every((e=>!!Pr(e)||this.#Ye(e)))}#Ze(e){let t=e;for(;t;){if(ic(t))return t;t=t.getParent()}return null}#Ge(e){const t=this.#Ze(e);if(!t)return;const n=t.getParent();if(!n||!dc(n))return;const r=n.getParent();if(r&&Hc(r)){const e=this.#Qe(t).filter((e=>!this.#Ye(e)));if(e.length>0)return void this.#et(r,n,t,e)}const i=_s();n.insertAfter(i),t.remove(),i.selectStart()}#Ve(e){const t=this.#Xe(e);if(!t)return!1;if(!this.#Ye(t))return!1;const n=t.getParent();return n&&Hc(n)}#Xe(e){let t=e;for(;t;){if(bs(t))return t;t=t.getParent()}return null}#Je(e){const t=this.#Xe(e);if(!t)return;const n=t.getParent();if(!n||!Hc(n))return;const r=this.#tt(t).filter((e=>!this.#Ye(e)));if(r.length>0)this.#nt(n,t,r);else{const e=_s();n.insertAfter(e),t.remove(),e.selectStart()}}#tt(e){const t=[];let n=e.getNextSibling();for(;n;)t.push(n),n=n.getNextSibling();return t}#Qe(e){const t=[];let n=e.getNextSibling();for(;n;)ic(n)&&t.push(n),n=n.getNextSibling();return t}#et(e,t,n,r){const i=this.#tt(t).filter((e=>!this.#Ye(e))),s=_s();e.insertAfter(s);const o=uc(t.getListType()),a=Uc();s.insertAfter(a),a.append(o),r.forEach((e=>{o.append(e)})),i.forEach((e=>{a.append(e)})),n.remove(),this.#rt(t),this.#it(a),0===t.getChildrenSize()?(t.remove(),0===e.getChildrenSize()&&e.remove()):this.#it(e),s.selectStart()}#rt(e){const t=e.getChildren();for(let e=t.length-1;e>=0;e--){const n=t[e];if(!ic(n)||!this.#Ye(n))break;n.remove()}}#it(e){const t=e.getChildren();for(let e=t.length-1;e>=0;e--){const n=t[e];if(!this.#Ye(n))break;n.remove()}}#nt(e,t,n){const r=_s();e.insertAfter(r);const i=Uc();r.insertAfter(i),n.forEach((e=>{i.append(e)})),t.remove(),this.#it(e),this.#it(i),r.selectStart()}}class Ud{constructor(e){this.editorElement=e,this.editor=e.editor,new $d(e).monitor()}insertHtml(e){this.editor.update((()=>{const t=vi();if(!si(t))return;const n=yc(this.editor,Td(e));t.insertNodes(n)}))}insertAtCursor(e){this.editor.update((()=>{const t=vi(),n=t?.getNodes();if(si(t))Ai([e]);else if(ai(t)&&n&&n.length>0){n[n.length-1].insertAfter(e)}else{eo().append(e)}}))}insertAtCursorEnsuringLineBelow(e){this.insertAtCursor(e),this.#st(e)}insertNodeWrappingEachSelectedLine(e){this.editor.update((()=>{const t=vi();if(!si(t))return;t.extract().forEach((t=>{if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e();r.append(...n.getChildren()),n.replace(r)}))}))}toggleNodeWrappingAllSelectedLines(e,t){this.editor.update((()=>{const n=vi();if(!si(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.removeFormattingFromSelectedLines():this.#ot(t)}))}toggleNodeWrappingAllSelectedNodes(e,t){this.editor.update((()=>{const n=vi();if(!si(n))return;const r=n.anchor.getNode().getTopLevelElement();r&&e(r)?this.#at(r):this.#lt(t)}))}removeFormattingFromSelectedLines(){this.editor.update((()=>{const e=vi();if(!si(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow(),n=_s();n.append(...t.getChildren()),t.replace(n)}))}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=vi();e=si(t)&&!t.isCollapsed()})),e}unwrapSelectedListItems(){this.editor.update((()=>{const e=vi();if(!si(e))return;const{listItems:t,parentLists:n}=this.#ct(e);if(t.size>0){const e=this.#ut(t);this.#dt(n),this.#ht(e)}}))}createLink(e){let t=null;return this.editor.update((()=>{const n=Vr(e),r=Wu(e);r.append(n);const i=vi();si(i)&&(i.insertNodes([r]),t=r.getKey())})),t}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{Ju(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=vi();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Jr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o),l=a.lastIndexOf(e);-1!==l&&(t=a.slice(l+e.length))})),t}containsTextBackUntil(e){let t=!1;return this.editor.getEditorState().read((()=>{const n=vi();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Jr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o);t=a.includes(e)})),t}replaceTextBackUntil(e,t){t=Array.isArray(t)?t:[t],this.editor.update((()=>{const{anchorNode:n,offset:r}=this.#gt();if(!n)return;const i=this.#pt(n,r,e);-1!==i&&this.#ft(n,r,i,t)}))}createParagraphAfterNode(e,t){const n=_s();e.insertAfter(n),n.selectStart(),t&&(n.append(Vr(t)),n.select(1,1))}createParagraphBeforeNode(e,t){const n=_s();e.insertBefore(n),n.selectStart(),t&&(n.append(Vr(t)),n.select(1,1))}uploadFile(e){if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");if(!this.#mt(e))return;const t=this.editorElement.directUploadUrl,n=this.editorElement.blobUrlTemplate;this.editor.update((()=>{const r=new Id({file:e,uploadUrl:t,blobUrlTemplate:n,editor:this.editor});this.insertAtCursor(r)}),{tag:Sr})}async deleteSelectedNodes(){let e=null;this.editor.update((()=>{if(ai(this.#yt.current)){const t=this.#yt.current.getNodes();if(0===t.length)return;e=this.#_t(t),this.#bt(t)}})),await Md(),this.editor.update((()=>{this.#xt(e),this.#yt.clear(),this.editor.focus()}))}replaceNodeWithHTML(e,t,n={}){this.editor.update((()=>{const r=Vs(e);if(!r)return;const i=vi();let s=!1;if(si(i)){const e=i.getNodes();s=e.includes(r)||e.some((e=>e.getParent()===r)),s&&no(null)}const o=n.attachment?this.#kt(t,n.attachment):this.#vt(t);r.replace(o),s&&o.selectEnd()}))}insertHTMLBelowNode(e,t,n={}){this.editor.update((()=>{const r=Vs(e);if(!r)return;const i=r.getTopLevelElement()||r,s=n.attachment?this.#kt(t,n.attachment):this.#vt(t);i.insertAfter(s)}))}get#yt(){return this.editorElement.selection}#st(e){this.editor.update((()=>{if(!e.getNextSibling()){const t=_s();e.insertAfter(t),t.selectStart()}}))}#at(e){e.getChildren().forEach((t=>{e.insertBefore(t)})),e.remove()}#lt(e){this.editor.update((()=>{const t=vi();if(!si(t))return;const n=t.extract();if(0===n.length)return;const r=new Set;n.forEach((e=>{const t=e.getTopLevelElementOrThrow();r.add(t)}));const i=this.#St(Array.from(r));if(0===i.length)return this.#wt(),void this.insertAtCursor(e());const s=e();i[0].insertBefore(s),i.forEach((e=>{s.append(e)}))}))}#St(e){let t=e.length-1;for(;t>=0;){const n=e[t];if(!bs(n)||!this.#Ct(n))break;t--}return e.slice(0,t+1)}#Ct(e){if(""!==e.getTextContent().trim())return!1;const t=e.getChildren();return 0===t.length||t.every((e=>Pr(e)))}#wt(){const e=eo();if(1===e.getChildrenSize()){const t=e.getFirstChild();t&&bs(t)&&this.#Ct(t)&&t.remove()}}#ot(e){this.editor.update((()=>{const t=vi();si(t)&&(t.isCollapsed()?this.#Et(t,e):this.#Tt(t,e))}))}#Et(e,t){const n=e.anchor.getNode().getTopLevelElementOrThrow();if(n.getTextContent()){const e=t();e.append(...n.getChildren()),n.replace(e)}else Ai([t()])}#Tt(e,t){const n=this.#Nt(e);if(0===n.length)return;const{lineSet:r,nodesToDelete:i}=this.#At(n);if(0===r.size)return;const s=this.#Lt(t,r);this.#Pt(e,s),this.#Ot(i)}#Nt(e){const t=e.extract().map((e=>this.#It(e))).filter(Boolean);return no(null),t}#It(e){return bs(e)?e:Jr(e)&&e.getParent()&&bs(e.getParent())?e.getParent():null}#At(e){const t=new Set,n=new Set;return e.forEach((e=>{const r=e.getTextContent();r&&r.split("\n").forEach((e=>{e.trim()&&t.add(e)})),n.add(e)})),{lineSet:t,nodesToDelete:n}}#Lt(e,t){const n=e(),r=Array.from(t);return r.forEach(((e,t)=>{n.append(Vr(e)),t<r.length-1&&n.append(Lr())})),n}#Pt(e,t){const n=e.anchor.getNode().getParent();n&&n.replace(t)}#Ot(e){e.forEach((e=>e.remove()))}#bt(e){e.forEach((e=>{const t=e.getParent();if(!ss(t))return;const n=t.getChildren().indexOf(e);n>=0&&t.splice(n,1,[])}))}#_t(e){const t=e[0],n=e[e.length-1];return t?.getPreviousSibling()||n?.getNextSibling()}#xt(e){const t=eo();if(0===t.getChildrenSize()){const e=_s();t.append(e),e.selectStart()}else e&&(Jr(e)||bs(e)?e.selectEnd():e.selectNext(0,0))}#ct(e){const t=e.getNodes(),n=new Set,r=new Set;for(const e of t){const t=Xu(e);if(t){n.add(t);const e=t.getParent();e&&dc(e)&&r.add(e)}}return{listItems:n,parentLists:r}}#ut(e){const t=[];for(const n of e){const e=this.#Ft(n);e&&t.push(e)}return t}#Ft(e){const t=e.getParent();if(!t||!dc(t))return null;const n=_s(),r=this.#Rt(e,n);return e.insertAfter(n),this.#Dt(n,r),e.remove(),n}#Rt(e,t){const n=[];return e.getChildren().forEach((e=>{dc(e)?n.push(e):t.append(e)})),n}#Dt(e,t){t.forEach((t=>{e.insertAfter(t)}))}#dt(e){for(const t of e)dc(t)&&0===t.getChildrenSize()&&t.remove()}#ht(e){if(0===e.length)return;const t=e[0],n=e[e.length-1];1===e.length?t.selectEnd():this.#Mt(t,n)}#Mt(e,t){e.selectStart();const n=vi();n&&si(n)&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#gt(){const e=vi();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Jr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#pt(e,t,n){return e.getTextContent().slice(0,t).lastIndexOf(n)}#ft(e,t,n,r){const i=e.getTextContent(),s=i.slice(0,n),o=i.slice(t),a=Vr(s),l=Vr(o||" ");e.replace(a);this.#zt(a,r).insertAfter(l),this.#Bt(l.getParentOrThrow());const c=o?0:1;l.select(c,c)}#zt(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#Bt(e){if(bs(e)&&!this.editorElement.isSingleLineMode){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Jr(n)&&""===n.getTextContent()&&r&&!Jr(r)&&e.append(Lr())}}#kt(e,t={}){return new Bd({sgid:("object"==typeof t?t:{}).sgid||null,contentType:"text/html",innerHtml:e})}#vt(e){return yc(this.editor,Td(e))[0]||_s()}#mt(e){return Ad(this.editorElement,"lexxy:file-accept",{file:e},!0)}}function Hd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wd={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Kd(e){Wd=e}var qd={exec:()=>null};function jd(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(Gd.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Gd={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Vd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jd=/(?:[*+-]|\d{1,9}[.)])/,Zd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Yd=jd(Zd).replace(/bull/g,Jd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Xd=jd(Zd).replace(/bull/g,Jd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,eh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,th=jd(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",eh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),nh=jd(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jd).getRegex(),rh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ih=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sh=jd("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",ih).replace("tag",rh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oh=jd(Qd).replace("hr",Vd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rh).getRegex(),ah={blockquote:jd(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",oh).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:th,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Vd,html:sh,lheading:Yd,list:nh,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:oh,table:qd,text:/^[^\n]+/},lh=jd("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rh).getRegex(),ch={...ah,lheading:Xd,table:lh,paragraph:jd(Qd).replace("hr",Vd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rh).getRegex()},uh={...ah,html:jd("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ih).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:jd(Qd).replace("hr",Vd).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Yd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dh=/^( {2,}|\\)\n(?!\s*$)/,hh=/[\p{P}\p{S}]/u,gh=/[\s\p{P}\p{S}]/u,ph=/[^\s\p{P}\p{S}]/u,fh=jd(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gh).getRegex(),mh=/(?!~)[\p{P}\p{S}]/u,yh=jd(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_h=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,bh=jd(_h,"u").replace(/punct/g,hh).getRegex(),xh=jd(_h,"u").replace(/punct/g,mh).getRegex(),kh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vh=jd(kh,"gu").replace(/notPunctSpace/g,ph).replace(/punctSpace/g,gh).replace(/punct/g,hh).getRegex(),Sh=jd(kh,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,mh).getRegex(),wh=jd("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ph).replace(/punctSpace/g,gh).replace(/punct/g,hh).getRegex(),Ch=jd(/\\(punct)/,"gu").replace(/punct/g,hh).getRegex(),Eh=jd(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Th=jd(ih).replace("(?:--\x3e|$)","--\x3e").getRegex(),Nh=jd("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Th).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ah=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Lh=jd(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ah).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ph=jd(/^!?\[(label)\]\[(ref)\]/).replace("label",Ah).replace("ref",eh).getRegex(),Oh=jd(/^!?\[(ref)\](?:\[\])?/).replace("ref",eh).getRegex(),Ih=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fh={_backpedal:qd,anyPunctuation:Ch,autolink:Eh,blockSkip:yh,br:dh,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:qd,emStrongLDelim:bh,emStrongRDelimAst:vh,emStrongRDelimUnd:wh,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Lh,nolink:Oh,punctuation:fh,reflink:Ph,reflinkSearch:jd("reflink|nolink(?!\\()","g").replace("reflink",Ph).replace("nolink",Oh).getRegex(),tag:Nh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:qd},Rh={...Fh,link:jd(/^!?\[(label)\]\((.*?)\)/).replace("label",Ah).getRegex(),reflink:jd(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ah).getRegex()},Dh={...Fh,emStrongRDelimAst:Sh,emStrongLDelim:xh,url:jd(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ih).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:jd(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ih).getRegex()},Mh={...Dh,br:jd(dh).replace("{2,}","*").getRegex(),text:jd(Dh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},zh={normal:ah,gfm:ch,pedantic:uh},Bh={normal:Fh,gfm:Dh,breaks:Mh,pedantic:Rh},$h={"&":"&","<":"<",">":">",'"':""","'":"'"},Uh=e=>$h[e];function Hh(e,t){if(t){if(Gd.escapeTest.test(e))return e.replace(Gd.escapeReplace,Uh)}else if(Gd.escapeTestNoEncode.test(e))return e.replace(Gd.escapeReplaceNoEncode,Uh);return e}function Wh(e){try{e=encodeURI(e).replace(Gd.percentDecode,"%")}catch{return null}return e}function Kh(e,t){let n=e.replace(Gd.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split(Gd.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Gd.slashPipe,"|");return r}function qh(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function jh(e,t,n,r,i){let s=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var Gh=class{options;rules;lexer;constructor(e){this.options=e||Wd}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:qh(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=qh(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:qh(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=qh(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===e.length)break;let u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.blockquote(s);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==u?.type);else{let t=u,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=s.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r="",a="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,a=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),s=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let h,g=e.split("\n",1)[0];if(c=g,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),i.test(c)||s.test(c)||o.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())a+="\n"+h.slice(d);else{if(u||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(l)||s.test(l)||n.test(l))break;a+="\n"+c}!u&&!c.trim()&&(u=!0),r+=g+"\n",e=e.substring(g.length+1),l=h.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let h,g=null;this.options.gfm&&(g=this.rules.other.listIsTask.exec(a),g&&(h="[ ] "!==g[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!g,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}let a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Kh(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Kh(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=qh(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),jh(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return jh(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=0,l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=l.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(i=[...n].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&s%3&&!((s+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let t=[...r[0]][0].length,l=e.slice(0,s+r.index+t+i);if(Math.min(s,i)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Vh=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Wd,this.options.tokenizer=this.options.tokenizer||new Gh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Gd,block:zh.normal,inline:Bh.normal};this.options.pedantic?(t.block=zh.pedantic,t.inline=Bh.pedantic):this.options.gfm&&(t.block=zh.gfm,this.options.breaks?t.inline=Bh.breaks:t.inline=Bh.gfm),this.tokenizer.rules=t}static get rules(){return{block:zh,inline:Bh}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Gd.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Gd.tabCharGlobal," ").replace(Gd.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,s="";for(;e;){let r;if(i||(s=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,s)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),i=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},Jh=class{options;parser;constructor(e){this.options=e||Wd}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(Gd.notSpaceStart)?.[0],i=e.replace(Gd.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Hh(r)+'">'+(n?i:Hh(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Hh(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+Hh(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Hh(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Wh(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+Hh(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Wh(e);if(null===i)return Hh(n);let s=`<img src="${e=i}" alt="${n}"`;return t&&(s+=` title="${Hh(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Hh(e.text)}},Zh=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Yh=class e{options;renderer;textRenderer;constructor(e){this.options=e||Wd,this.options.renderer=this.options.renderer||new Jh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zh}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){n+=t||"";continue}}let s=i;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":{let i=s,o=this.renderer.text(i);for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+this.renderer.text(i);n+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}let s=i;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Xh=class{options;block;constructor(e){this.options=e||Wd}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Vh.lex:Vh.lexInline}provideParser(){return this.block?Yh.parse:Yh.parseInline}},Qh=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Yh;Renderer=Jh;TextRenderer=Zh;Lexer=Vh;Tokenizer=Gh;Hooks=Xh;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Jh(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Gh(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Xh;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];Xh.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Xh.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return s.call(t,n)})();let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await s.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Vh.lex(e,t??this.defaults)}parser(e,t){return Yh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?Vh.lex:Vh.lexInline)(n,i),s=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?Yh.parse:Yh.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?Vh.lex:Vh.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?Yh.parse:Yh.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Hh(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function eg(e,t){return Qh.parse(e,t)}function tg(e){try{return new URL(e),!0}catch{return!1}}function ng(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}eg.options=eg.setOptions=function(e){return Qh.setOptions(e),eg.defaults=Qh.defaults,Kd(eg.defaults),eg},eg.getDefaults=Hd,eg.defaults=Wd,eg.use=function(...e){return Qh.use(...e),eg.defaults=Qh.defaults,Kd(eg.defaults),eg},eg.walkTokens=function(e,t){return Qh.walkTokens(e,t)},eg.parseInline=Qh.parseInline,eg.Parser=Yh,eg.parser=Yh.parse,eg.Renderer=Jh,eg.TextRenderer=Zh,eg.Lexer=Vh,eg.lexer=Vh.lex,eg.Tokenizer=Gh,eg.Hooks=Xh,eg.parse=eg,eg.options,eg.setOptions,eg.use,eg.walkTokens,eg.parseInline,Yh.parse,Vh.lex;class rg{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){const t=e.clipboardData;return!!t&&(this.#$t(t)&&!this.#Ut()?(this.#Ht(t),e.preventDefault(),!0):void this.#Wt(t))}#$t(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#Ut(){let e=!1;return this.editor.getEditorState().read((()=>{const t=vi();if(!si(t))return;let n=t.anchor.getNode();for(;n;){if(lu(n))return void(e=!0);n=n.getParent()}})),e}#Ht(e){e.items[0].getAsString((e=>{if(tg(e)&&this.contents.hasSelectedText())this.contents.createLinkWithSelectedText(e);else if(tg(e)){const t=this.contents.createLink(e);this.#Kt(t,{url:e})}else this.#qt(e)}))}#Kt(e,t){const n={replaceLinkWith:(t,n)=>this.contents.replaceNodeWithHTML(e,t,n),insertBelowLink:(t,n)=>this.contents.insertHTMLBelowNode(e,t,n)};Ad(this.editorElement,"lexxy:insert-link",{...t,...n})}#qt(e){const t=eg(e);this.contents.insertHtml(t)}#Wt(e){if(!this.editorElement.supportsAttachments)return;e.getData("text/html")||this.#jt((()=>{for(const t of e.items){const e=t.getAsFile();e&&this.contents.uploadFile(e)}}))}async#jt(e){const t=window.scrollY,n=window.scrollX;e(),await Md(),window.scrollTo(n,t),this.editor.focus()}}class ig{constructor(e){this.editor=e.editor,this.#Gt()}toggle(e){this.editor.update((()=>{this.#Vt(e)}))}remove(){this.toggle({color:null,"background-color":null})}#Gt(){return this.editor.registerNodeTransform(Br,(e=>{this.#Jt(e)}))}#Vt(e){const t=vi();if(!si(t))return;const n={};for(const r in e){const i=al(t,r);n[r]=this.#Zt(i,e[r])}el(t,n)}#Zt(e,t){return e===t?null:t}#Jt(e){nd(e.getStyle())!==e.hasFormat("highlight")&&e.toggleFormat("highlight")}}class sg extends Br{$config(){return this.config("highlight",{extends:Br})}static importDOM(){return{mark:()=>({conversion:ed("mark",og),priority:1})}}}function og(e,t){const n=t.style?.color,r=t.style?.backgroundColor;let i="";if(n&&""!==n&&(i+=`color: ${n};`),r&&""!==r&&(i+=`background-color: ${r};`),i.length)return e.hasFormat("highlight")||e.toggleFormat("highlight"),e.setStyle(e.getStyle()+i)}const ag="language";class lg extends Br{$config(){return this.config("trix-text",{extends:Br})}static importDOM(){return{em:e=>cg(e,{conversion:ed("i",og),priority:1}),span:e=>cg(e,{conversion:ed("mark",og),priority:1}),strong:e=>cg(e,{conversion:ed("b",og),priority:1}),del:()=>({conversion:ed("s",ug),priority:1}),pre:e=>function(e,t){return e.hasAttribute(ag)?t:null}(e,{conversion:td(ou,"pre",dg),priority:1})}}}function cg(e,t){return""!==e.style.color||""!==e.style.backgroundColor?t:null}function ug(e,t){return e.hasFormat("strikethrough")||e.toggleFormat("strikethrough"),og(e,t)}function dg(e,t){const n=Cu(t.getAttribute(ag));e.node.setLanguage(n)}class hg extends HTMLElement{static formAssociated=!0;static debug=!0;static commands=["bold","italic","strikethrough"];static observedAttributes=["connected","required"];#Yt="";#Xt=document.createElement("textarea");constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=Ld("lexxy-editor"),this.editor=this.#Qt(),this.contents=new Ud(this),this.selection=new zd(this),this.clipboard=new rg(this),this.highlighter=new ig(this),Dd.configureFor(this),this.#en(),requestAnimationFrame((()=>Ad(this,"lexxy:initialize"))),this.toggleAttribute("connected",!0),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,this.#tn()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#nn())),"required"===e&&this.isConnected&&(this.#Xt.required=this.hasAttribute("required"),this.#rn())}formResetCallback(){this.value=this.#Yt,this.editor.dispatchCommand(Mn,void 0)}get form(){return this.internals.form}get name(){return this.getAttribute("name")}get toolbarElement(){return this.#in?(this.toolbar=this.toolbar||this.#sn(),this.toolbar):null}get directUploadUrl(){return this.dataset.directUploadUrl}get blobUrlTemplate(){return this.dataset.blobUrlTemplate}get isSingleLineMode(){return this.hasAttribute("single-line")}get supportsAttachments(){return"false"!==this.getAttribute("attachments")}focus(){this.editor.focus()}get value(){return this.cachedValue||this.editor?.getEditorState().read((()=>{this.cachedValue=function(e){return se.sanitize(e)}(_c(this.editor,null))})),this.cachedValue}set value(e){this.editor.update((()=>{No(Er);const t=eo();t.clear(),""!==e&&t.append(...this.#on(e)),t.select(),this.#an(),requestAnimationFrame((()=>this.editor?.update((()=>{}))))}))}#on(e){e||(e="<p></p>");return yc(this.editor,Td(`<div>${e}</div>`)).map((e=>{if("paragraph"===e.getType()&&1===e.getChildrenSize()){const t=e.getFirstChild();if(t instanceof as&&!t.isInline())return t}return e}))}#en(){this.#ln(),this.#cn(),this.#un(),this.#dn(),this.#hn(),this.#gn(),this.#pn(),this.#fn(),this.#mn()}#Qt(){this.editorContentElement=this.editorContentElement||this.#yn();const e=vs({namespace:"LexicalEditor",onError(e){throw e},theme:Cd,nodes:this.#_n});return e.setRootElement(this.editorContentElement),e}get#_n(){const e=[lg,sg,$c,Wc,sc,ec,ou,fu,Uu,qu,Fd,Bd];return this.supportsAttachments&&e.push(Od,Id),e}#yn(){const e=Ed("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#bn,placeholder:this.getAttribute("placeholder")});return e.id=`${this.id}-content`,this.#xn.forEach((t=>e.setAttribute(t.name,t.value))),this.appendChild(e),this.getAttribute("tabindex")?(e.setAttribute("tabindex",this.getAttribute("tabindex")),this.removeAttribute("tabindex")):e.setAttribute("tabindex",0),e}get#bn(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#xn(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}set#kn(e){const t=void 0!==this.#kn&&this.#kn!==this.value;this.internals.setFormValue(e),this._internalFormValue=e,this.#Xt.value=this.#vn?"":e,t&&Ad(this,"lexxy:change")}get#kn(){return this._internalFormValue}#fn(){const e=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=this.#Yt=e}#mn(){document.addEventListener("turbo:before-cache",this.#Sn)}#Sn=e=>{this.#tn()};#ln(){this.#wn(this.editor.registerUpdateListener((({editorState:e})=>{this.cachedValue=null,this.#kn=this.value,this.#an(),this.#rn()})))}#wn(e){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(e)}#Cn(){this.unregisterHandlers?.forEach((e=>{e()})),this.unregisterHandlers=null}#cn(){Qc(this.editor),this.historyState={current:null,redoStack:[],undoStack:[]},Sd(this.editor,this.historyState,20),mc(this.editor),this.#En(),xd(this.editor,yd)}#En(){!function(e,t){if(!e.hasNodes([ou,fu]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=Au);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(ou,(t=>{e.getEditorState().read((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Vs(n);null!==t&&Pu(t,e)}}))}),{skipInitialization:!1})),n.push(e.registerNodeTransform(ou,(n=>Iu(n,e,t))),e.registerNodeTransform(Br,(n=>Lu(n,e,t))),e.registerNodeTransform(fu,(n=>Lu(n,e,t))),e.registerCommand(wn,(t=>{const n=function(e){const t=vi();if(!si(t)||!Ru(t))return null;const n=e?Tn:En,r=e?Tn:Cn,i=t.anchor,s=t.focus;if(i.is(s))return r;const o=Du(t);if(1!==o.length)return n;const a=o[0];let l,c;0===a.length&&tu(285),t.isBackward()?(l=s,c=i):(l=i,c=s);const u=xu(a[0]),d=ku(a[0]),h=ti(u.getKey(),0,"text"),g=ti(d.getKey(),d.getTextContentSize(),"text");return l.isBefore(h)||g.isBefore(c)?n:h.isBefore(l)||c.isBefore(g)?r:n}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),1),e.registerCommand(Cn,(()=>!!Ru(vi())&&(Ai([Xr()]),!0)),1),e.registerCommand(En,(e=>Mu(En)),1),e.registerCommand(Tn,(e=>Mu(Tn)),1),e.registerCommand(yn,(e=>{const t=vi();if(!si(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Ru(t)&&(t.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&lu(r.getParentOrThrow())?(e.preventDefault(),!0):zu(yn,e))}),1),e.registerCommand(_n,(e=>{const t=vi();if(!si(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Ru(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&lu(r.getParentOrThrow())?(e.preventDefault(),!0):zu(_n,e))}),1),e.registerCommand(mn,(e=>Bu(mn,e)),1),e.registerCommand(pn,(e=>Bu(pn,e)),1)),gl(...n)}(this.editor),this.append(Ed("lexxy-code-language-picker"))}#un(){this.editor.getRootElement().addEventListener("lexxy:internal:invalidate-node",(e=>{const{key:t,values:n}=e.detail;this.editor.update((()=>{const e=Vs(t);if(e instanceof Od){const t=e.getWritable();Object.assign(t,n)}}))}))}#dn(){this.editor.registerCommand(bn,(e=>(e.ctrlKey||e.metaKey||!!this.isSingleLineMode)&&(e.preventDefault(),!0)),2)}#hn(){this.editor.registerCommand(Un,(()=>{Ad(this,"lexxy:blur")}),2),this.editor.registerCommand($n,(()=>{Ad(this,"lexxy:focus")}),2)}#gn(){hg.debug&&this.#wn(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{console.debug("HTML: ",this.value)}))})))}#pn(){this.#in&&this.toolbarElement.setEditor(this)}#sn(){const e=this.getAttribute("toolbar");return e?document.getElementById(e):this.#Tn()}get#in(){return"false"!==this.getAttribute("toolbar")}#Tn(){const e=Ed("lexxy-toolbar");return e.innerHTML=rd.defaultTemplate,e.setAttribute("data-attachments",this.supportsAttachments),this.prepend(e),e}#an(){this.classList.toggle("lexxy-editor--empty",this.#vn)}get#vn(){return["<p><br></p>","<p></p>",""].includes(this.value.trim())}#rn(){this.#Xt.validity.valid?this.internals.setValidity({}):this.internals.setValidity(this.#Xt.validity,this.#Xt.validationMessage,this.editorContentElement)}#tn(){this.#Cn(),this.editorContentElement&&(this.editorContentElement.remove(),this.editorContentElement=null),this.contents=null,this.editor=null,this.toolbar&&(this.getAttribute("toolbar")||this.toolbar.remove(),this.toolbar=null),this.selection=null,document.removeEventListener("turbo:before-cache",this.#Sn)}#nn(){this.disconnectedCallback(),this.connectedCallback()}}customElements.define("lexxy-editor",hg);class gg extends HTMLElement{connectedCallback(){this.dialog=this.querySelector("dialog"),"closedBy"in this.dialog.constructor.prototype&&(this.dialog.closedBy="any"),this.#Nn()}disconnectedCallback(){this.#An()}updateStateCallback(){}show(e){this.preventImmediateReopen||(this.triggerButton=e,this.#Ln(),this.dialog.show(),this.#Pn())}close(){this.dialog.close()}get toolbar(){return this.closest("lexxy-toolbar")}get editor(){return this.toolbar.editor}get open(){return this.dialog.open}#Nn(){this.#On(),this.dialog.addEventListener("cancel",this.#In.bind(this)),this.dialog.addEventListener("close",this.#Fn.bind(this))}#Fn(){this.#An(),this.triggerButton=null,this.editor.focus()}#In(){this.preventImmediateReopen=!0,requestAnimationFrame((()=>this.preventImmediateReopen=void 0))}#Ln(){const e=this.triggerButton.offsetLeft;this.dialog.style.insetInlineStart=`${e}px`}#Pn(){this.#Rn||this.clickOutsideHandler||(this.clickOutsideHandler=this.#Dn.bind(this),document.addEventListener("click",this.clickOutsideHandler,!0))}#An(){this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler,!0),this.clickOutsideHandler=null)}#Dn({target:e}){if(!this.dialog.open)return;const t=this.dialog.contains(e),n=this.triggerButton.contains(e);t||n||this.close()}#On(){this.#Rn||this.addEventListener("keydown",this.#Mn.bind(this))}get#Rn(){return"any"===this.dialog.closedBy}#Mn(e){"Escape"===e.key&&(e.stopPropagation(),this.close())}}customElements.define("lexxy-link-dialog",class extends gg{connectedCallback(){super.connectedCallback(),this.input=this.querySelector("input"),this.#Nn()}updateStateCallback(){this.input.value=this.#zn}#Nn(){this.dialog.addEventListener("beforetoggle",this.#Bn.bind(this)),this.dialog.addEventListener("submit",this.#$n.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#Un.bind(this))}#Bn({newState:e}){this.input.required="open"===e}#$n(e){const t=e.submitter?.value;this.editor.dispatchCommand(t,this.input.value)}#Un(){this.editor.dispatchCommand("unlink"),this.close()}get#zn(){let e="";return this.editor.getEditorState().read((()=>{const t=vi();if(!si(t))return;let n=t.getNodes()[0];for(;n&&n.getParent();){if(Ku(n)){e=n.getURL();break}n=n.getParent()}})),e}});const pg="button.lexxy-highlight-button",fg="[data-command='removeHighlight']",mg=Symbol("no_style");customElements.define("lexxy-highlight-dialog",class extends gg{connectedCallback(){super.connectedCallback(),this.#Hn(),this.#Nn()}updateStateCallback(){this.#Wn(vi())}#Nn(){this.querySelector(fg).addEventListener("click",this.#Kn.bind(this)),this.#qn.forEach((e=>e.addEventListener("click",this.#jn.bind(this))))}#Hn(){this.#Gn.forEach((e=>{this.#Vn(e)}))}#Vn(e){const t=e.dataset.values?.split("; ")||[],n=e.dataset.buttonGroup;t.forEach(((t,r)=>{e.appendChild(this.#Jn(n,t,r))}))}#Jn(e,t,n){const r=document.createElement("button");return r.dataset.style=e,r.style.setProperty(e,t),r.dataset.value=t,r.classList.add("lexxy-highlight-button"),r.name=e+"-"+n,r}#jn(e){e.preventDefault();const t=e.target.closest(pg);if(!t)return;const n=t.dataset.style,r=t.dataset.value;this.editor.dispatchCommand("toggleHighlight",{[n]:r}),this.close()}#Kn(e){e.preventDefault(),this.editor.dispatchCommand("removeHighlight"),this.close()}#Wn(e){if(!si(e))return;const t=al(e,"color",mg),n=al(e,"background-color",mg);this.#qn.forEach((e=>{const r=e.dataset.value===t||e.dataset.value===n;e.setAttribute("aria-pressed",r)}));const r=t!==mg||n!==mg;this.querySelector(fg).disabled=!r}get#Gn(){return this.querySelectorAll("[data-button-group]")}get#qn(){return Array.from(this.querySelectorAll(pg))}});class yg{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=Ed("li",{role:"option",id:Ld("prompt-item"),tabindex:"0"});return n.classList.add("lexxy-prompt-menu__item"),n.appendChild(t),n}async loadPromptItemsFromUrl(e){try{const t=await fetch(e),n=Td(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}class _g extends yg{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#Zn(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#Zn(e,t){const n=[];return this.promptItemByListItem=new WeakMap,e.forEach((e=>{const r=e.getAttribute("search");if(!t||function(e,t){return ng(e).includes(ng(t))}(r,t)){const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),n.push(t)}})),n}}class bg extends _g{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class xg extends _g{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}class kg extends yg{constructor(e){super(),this.baseURL=e,this.loadAndFilterListItems=function(e,t){let n;return(...r)=>(clearTimeout(n),new Promise(((i,s)=>{n=setTimeout((async()=>{try{const t=await e(...r);i(t)}catch(e){s(e)}}),t)})))}(this.fetchFilteredListItems.bind(this),200)}async buildListItems(e=""){return await this.loadAndFilterListItems(e)}promptItemFor(e){return this.promptItemByListItem.get(e)}async fetchFilteredListItems(e){const t=await this.loadPromptItemsFromUrl(this.#Yn(e));return this.#Zn(t)}#Yn(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#Zn(e){const t=[];this.promptItemByListItem=new WeakMap;for(const n of e){const e=this.buildListItemElementFor(n);this.promptItemByListItem.set(e,n),t.push(e)}return t}}class vg extends HTMLElement{constructor(){super(),this.keyListeners=[]}connectedCallback(){this.source=this.#Xn(),this.#Qn()}disconnectedCallback(){this.source=null,this.popoverElement=null}get name(){return this.getAttribute("name")}get trigger(){return this.getAttribute("trigger")}get supportsSpaceInSearches(){return this.hasAttribute("supports-space-in-searches")}get open(){return this.popoverElement?.classList?.contains("lexxy-prompt-menu--visible")}get closed(){return!this.open}get#er(){return!this.supportsSpaceInSearches}#Xn(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new kg(e):new xg(e):new bg(this.querySelectorAll("lexxy-prompt-item"))}#Qn(){const e=this.#tr.registerUpdateListener((()=>{this.#tr.read((()=>{const{node:t,offset:n}=this.#yt.selectedNodeWithOffset();if(t&&Jr(t)&&n>0){const r=t.getTextContent();if(r[n-1]===this.trigger){const t=1===n,i=n>1?r[n-2]:null;(t||(" "===i||"\n"===i))&&(e(),this.#nr())}}}))}))}#rr(){this.cursorPositionListener=this.#tr.registerUpdateListener((()=>{this.closed||this.#tr.read((()=>{const{node:e,offset:t}=this.#yt.selectedNodeWithOffset();if(e)if(Jr(e)&&t>0){const n=e.getTextContent().slice(0,t).lastIndexOf(this.trigger);(-1===n||t<=n)&&this.#ir()}else this.#ir()}))}))}#sr(){this.cursorPositionListener&&(this.cursorPositionListener(),this.cursorPositionListener=null)}get#tr(){return this.#or.editor}get#or(){return this.closest("lexxy-editor")}get#yt(){return this.#or.selection}async#nr(){this.popoverElement??=await this.#ar(),this.#lr(),await this.#cr(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#ur(),this.#or.addEventListener("keydown",this.#dr),this.#or.addEventListener("lexxy:change",this.#cr),this.#hr(),this.#rr()}#hr(){this.keyListeners.push(this.#tr.registerCommand(bn,this.#gr.bind(this),3)),this.keyListeners.push(this.#tr.registerCommand(wn,this.#gr.bind(this),3)),this.#er&&this.keyListeners.push(this.#tr.registerCommand(xn,this.#gr.bind(this),3)),this.keyListeners.push(this.#tr.registerCommand(yn,this.#pr.bind(this),3)),this.keyListeners.push(this.#tr.registerCommand(_n,this.#fr.bind(this),3))}#pr(e){return this.#mr(),e.preventDefault(),!0}#fr(e){return this.#yr(),e.preventDefault(),!0}#ur(){const e=this.#_r[0];e&&this.#br(e)}get#_r(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#br(e){this.#xr(),e.toggleAttribute("aria-selected",!0),e.scrollIntoView({block:"nearest",behavior:"smooth"}),e.focus(),this.#yt.preservingSelection((()=>{this.#or.focus()})),this.#kr.setAttribute("aria-controls",this.popoverElement.id),this.#kr.setAttribute("aria-activedescendant",e.id),this.#kr.setAttribute("aria-haspopup","listbox")}#xr(){this.#_r.forEach((e=>{e.toggleAttribute("aria-selected",!1)})),this.#kr.removeAttribute("aria-controls"),this.#kr.removeAttribute("aria-activedescendant"),this.#kr.removeAttribute("aria-haspopup")}#vr(){const{x:e,y:t,fontSize:n}=this.#yt.cursorPosition,r=this.#or.getBoundingClientRect(),i=this.#kr.getBoundingClientRect().top-r.top;this.popoverElement.hasAttribute("data-anchored")||(this.popoverElement.style.left=`${e}px`,this.popoverElement.toggleAttribute("data-anchored",!0)),this.popoverElement.style.top=`${t+i}px`,this.popoverElement.style.bottom="auto";const s=this.popoverElement.getBoundingClientRect();(s.bottom>window.innerHeight||this.popoverElement.hasAttribute("data-clipped-at-bottom"))&&(this.popoverElement.style.top=t+i-s.height-n+"px",this.popoverElement.style.bottom="auto",this.popoverElement.toggleAttribute("data-clipped-at-bottom",!0))}#lr(){this.popoverElement.removeAttribute("data-clipped-at-bottom"),this.popoverElement.removeAttribute("data-anchored")}async#ir(){this.#xr(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#or.removeEventListener("lexxy:change",this.#cr),this.#or.removeEventListener("keydown",this.#dr),this.#Sr(),this.#sr(),await Md(),this.#Qn()}#Sr(){this.keyListeners.forEach((e=>e())),this.keyListeners=[]}#cr=async()=>{this.initialPrompt?this.initialPrompt=!1:this.#wr.containsTextBackUntil(this.trigger)?(await this.#Cr(),await Md(),this.#vr()):this.#ir()};async#Cr(){const e=this.#wr.textBackUntil(this.trigger),t=await this.source.buildListItems(e);this.popoverElement.innerHTML="",t.length>0?this.#Er(t):this.#Tr(),this.#ur()}#Er(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#Tr(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=Ed("li",{innerHTML:this.#Nr});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#Nr(){return this.getAttribute("empty-results")||"Nothing found"}#dr=e=>{"Escape"===e.key&&(this.#ir(),this.#or.focus(),e.stopPropagation())};#yr(){const e=this.#Ar+1;e<this.#_r.length&&this.#br(this.#_r[e])}#mr(){const e=this.#Ar-1;e>=0&&this.#br(this.#_r[e])}get#Ar(){return this.#_r.findIndex((e=>e.hasAttribute("aria-selected")))}get#Lr(){return this.#_r[this.#Ar]}#gr(e){return e.preventDefault(),e.stopPropagation(),this.#Pr(),!0}#Pr(){this.#Or(),this.#ir(),this.#or.focus()}#Or(){const e=this.source.promptItemFor(this.#Lr);if(!e)return;const t=e.querySelector("template[type='editor']"),n=`${this.trigger}${this.#wr.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#Ir(t,n):this.#Fr(e,t,n)}#Ir(e,t){this.#tr.update((()=>{const n=yc(this.#tr,Td(`${e.innerHTML}`));this.#wr.replaceTextBackUntil(t,n)}))}#Fr(e,t,n){this.#tr.update((()=>{const r=new Bd({sgid:e.getAttribute("sgid"),contentType:`application/vnd.actiontext.${this.name}`,innerHtml:t.innerHTML});this.#wr.replaceTextBackUntil(n,r)}))}get#wr(){return this.#or.contents}get#kr(){return this.#or.editorContentElement}async#ar(){const e=Ed("ul",{role:"listbox",id:Ld("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.setAttribute("nonce",cl()),e.append(...await this.source.buildListItems()),e.addEventListener("click",this.#Rr),this.#or.appendChild(e),e}#Rr=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#br(t),this.#Pr())}}customElements.define("lexxy-prompt",vg);class Sg extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.#Dr(),this.#Mr()}#Dr(){this.languagePickerElement=this.#zr(),this.languagePickerElement.addEventListener("change",(()=>{this.#Br(this.languagePickerElement.value)})),this.languagePickerElement.style.position="absolute",this.languagePickerElement.setAttribute("nonce",cl()),this.editorElement.appendChild(this.languagePickerElement)}#zr(){const e=Ed("select",{hidden:!0,className:"lexxy-code-language-picker","aria-label":"Pick a language…",name:"lexxy-code-language"});for(const[t,n]of Object.entries(this.#$r)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#$r(){const e={...Su};e.ruby||(e.ruby="Ruby"),e.php||(e.php="PHP"),e.go||(e.go="Go"),e.bash||(e.bash="Bash"),e.json||(e.json="JSON"),e.diff||(e.diff="Diff");const t=Object.entries(e).sort((([,e],[,t])=>e.localeCompare(t))),n=t.findIndex((([e])=>"plain"===e)),r=t.splice(n,1)[0];return Object.fromEntries([r,...t])}#Br(e){this.editor.update((()=>{const t=this.#Ur();t&&t.setLanguage(e)}))}#Mr(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{const e=this.#Ur();e?this.#Hr(e):this.#Wr()}))}))}#Ur(){const e=vi();if(!si(e))return null;const t=e.anchor.getNode(),n=t.getParent();return lu(t)?t:lu(n)?n:null}#Hr(e){const t=e.getLanguage();this.#Kr(t),this.#qr(),this.#jr(e)}#Kr(e){if(this.languagePickerElement&&e){const t=Cu(e);this.languagePickerElement.value=t}}#jr(e){const t=this.editor.getElementByKey(e.getKey());if(!t)return;const n=t.getBoundingClientRect(),r=this.editorElement.getBoundingClientRect(),i=n.top-r.top;this.languagePickerElement.style.top=`${i}px`}#qr(){this.languagePickerElement.hidden=!1}#Wr(){this.languagePickerElement.hidden=!0}}function wg(){document.querySelectorAll("pre[data-language]").forEach((e=>{!function(e){const t=e.getAttribute("data-language");let n=e.innerHTML.replace(/<br\s*\/?>/gi,"\n");const r=Prism.languages[t];if(!r)return;n=(new DOMParser).parseFromString(n,"text/html").body.textContent||"";const i=Prism.highlight(n,r,t),s=Ed("code",{"data-language":t,innerHTML:i});e.replaceWith(s)}(e)}))}customElements.define("lexxy-code-language-picker",Sg),window.Prism=window.Prism||{},Prism.manual=!0;export{wg as highlightAll};
|
|
10
|
+
*/function tu(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}"undefined"!=typeof module&&module.exports&&(module.exports=eu),"undefined"!=typeof global&&(global.Prism=eu),eu.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},eu.languages.markup.tag.inside["attr-value"].inside.entity=eu.languages.markup.entity,eu.languages.markup.doctype.inside["internal-subset"].inside=eu.languages.markup,eu.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(eu.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:eu.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:eu.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},eu.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(eu.languages.markup.tag,"addAttribute",{value:function(e,t){eu.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:eu.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),eu.languages.html=eu.languages.markup,eu.languages.mathml=eu.languages.markup,eu.languages.svg=eu.languages.markup,eu.languages.xml=eu.languages.extend("markup",{}),eu.languages.ssml=eu.languages.xml,eu.languages.atom=eu.languages.xml,eu.languages.rss=eu.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(eu),eu.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},eu.languages.javascript=eu.languages.extend("clike",{"class-name":[eu.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),eu.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,eu.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:eu.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:eu.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:eu.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:eu.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:eu.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),eu.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:eu.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),eu.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),eu.languages.markup&&(eu.languages.markup.tag.addInlined("script","javascript"),eu.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),eu.languages.js=eu.languages.javascript,function(){if(void 0!==eu&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",r="loaded",i="pre[data-src]:not(["+t+'="'+r+'"]):not(['+t+'="'+n+'"])';eu.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),eu.hooks.add("before-sanity-check",(function(s){var o=s.element;if(o.matches(i)){s.code="",o.setAttribute(t,n);var a=o.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=o.getAttribute("data-src"),c=s.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}eu.util.setLanguage(a,c),eu.util.setLanguage(o,c);var d=eu.plugins.autoloader;d&&d.loadLanguages(c),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(l,(function(e){o.setAttribute(t,r);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var i=e.split(/\r\n?|\n/g),s=n[0],l=null==n[1]?i.length:n[1];s<0&&(s+=i.length),s=Math.max(0,Math.min(s-1,i.length)),l<0&&(l+=i.length),l=Math.max(0,Math.min(l,i.length)),e=i.slice(s,l).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(s+1))}a.textContent=e,eu.highlightElement(a)}),(function(e){o.setAttribute(t,"failed"),a.textContent=e}))}})),eu.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)eu.highlightElement(t)}};var s=!1;eu.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),eu.plugins.fileHighlight.highlight.apply(this,arguments)}}}(),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var s=i.content[1],o=i.content[3];if(s&&o&&"code-language"===s.type&&"code-block"===o.type&&"string"==typeof s.content){var a=s.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,l]:o.alias.push(l):o.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var s=t.classes[r],c=/language-(.+)/.exec(s);if(c){n=c[1];break}}var u=e.languages[n];if(u)t.content=e.highlight(function(e){var t=e.replace(o,"");return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=a[t];return r||e})),t}(t.content),u,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift})),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism);function nu(e,t){for(const n of e.childNodes){if(Bo(n)&&n.tagName===t)return!0;nu(n,t)}return!1}const ru="data-language",iu="data-highlight-language",su="data-theme";let ou=class e extends is{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");pl(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(ru,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(iu,n));const r=this.getTheme();r&&t.setAttribute(su,r);const i=this.getStyle();return i&&t.setAttribute("style",i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(ru,r):i&&t.removeAttribute(ru);const s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?s&&r?r!==i&&t.setAttribute(iu,r):t.removeAttribute(iu):s&&r&&t.setAttribute(iu,r);const o=this.__theme,a=e.__theme;o?o!==a&&t.setAttribute(su,o):a&&t.removeAttribute(su);const l=this.__style,c=e.__style;return l?l!==c&&t.setAttribute("style",l):c&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");pl(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(ru,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(iu,n));const r=this.getTheme();r&&t.setAttribute(su,r);const i=this.getStyle();return i&&t.setAttribute("style",i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||nu(e,"BR"))?{conversion:cu,priority:1}:null,div:()=>({conversion:uu,priority:1}),pre:()=>({conversion:cu,priority:0}),table:e=>pu(e)?{conversion:du,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&pu(n)?{conversion:hu,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&pu(t)?{conversion:hu,priority:3}:null}}}static importJSON(e){return au().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const e=_s();return this.insertAfter(e,t),e}const{anchor:i,focus:s}=e,o=(i.isBefore(s)?i:s).getNode();if(Jr(o)){let e=xu(o);const t=[];for(;;)if(Qr(e))t.push(Xr()),e=e.getNextSibling();else{if(!_u(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(yu(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const n=o.splitText(i.offset)[0],r=0===i.offset?0:1,s=n.getIndexWithinParent()+r,a=o.getParentOrThrow(),l=[Lr(),...t];a.splice(s,0,l);const c=t[t.length-1];c?c.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(lu(o)){const{offset:t}=e.anchor;o.splice(t,0,[Lr()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=_s();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function au(e,t){return function(e){const t=qo();return $i(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}(ou).setLanguage(e).setTheme(t)}function lu(e){return e instanceof ou}function cu(e){return{node:au(e.getAttribute(ru))}}function uu(e){const t=e,n=gu(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(gu(t))return!0;t=t.parentElement}return!1}(t)?{node:n?au():null}:{node:null}}function du(){return{node:au()}}function hu(){return{node:null}}function gu(e){return null!==e.style.fontFamily.match("monospace")}function pu(e){return e.classList.contains("js-file-line-container")}let fu=class e extends Br{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return pl(t,mu(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=mu(n.theme,e.__highlightType),s=mu(n.theme,this.__highlightType);return i!==s&&(i&&fl(t,i),s&&pl(t,s)),r}static importJSON(e){return yu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return au()}};function mu(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function yu(e="",t){return Io(new fu(e,t))}function _u(e){return e instanceof fu}function bu(e,t){let n=e;for(let r=fa(e,t);r&&(_u(r.origin)||Qr(r.origin));r=ml(r))n=r.origin;return n}function xu(e){return bu(e,"previous")}function ku(e){return bu(e,"next")}!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const vu=globalThis.Prism||window.Prism,Su={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},wu={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Cu(e){return wu[e]||e}function Eu(e){return"string"==typeof e?e:Array.isArray(e)?e.map(Eu).join(""):Eu(e.content)}function Tu(e,t){const n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent();let i=vu.tokenize(r,vu.languages[n?"diff":t]);return n&&(i=function(e,t){const n=t,r=vu.languages[n],i={tokens:e},s=vu.languages.diff.PREFIXES;for(const e of i.tokens){if("string"==typeof e||!(e.type in s)||!Array.isArray(e.content))continue;const t=e.type;let n=0;const i=()=>(n++,new vu.Token("prefix",s[t],t.replace(/^(\w+).*/,"$1"))),o=e.content.filter((e=>"string"==typeof e||"prefix"!==e.type)),a=e.content.length-o.length,l=vu.tokenize(Eu(o),r);l.unshift(i());const c=/\r\n|\n/g,u=e=>{const t=[];c.lastIndex=0;let r,s=0;for(;n<a&&(r=c.exec(e));){const n=r.index+r[0].length;t.push(e.slice(s,n)),s=n,t.push(i())}if(0!==t.length)return s<e.length&&t.push(e.slice(s)),t},d=e=>{for(let t=0;t<e.length&&n<a;t++){const n=e[t];if("string"==typeof n){const r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if("string"==typeof n.content){const e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?d(n.content):d([n.content])}};d(l),n<a&&l.push(i()),e.content=l}return i.tokens}(i,n[1])),Nu(i)}function Nu(e,t){const n=[];for(const r of e)if("string"==typeof r){const e=r.split(/(\n|\t)/),i=e.length;for(let r=0;r<i;r++){const i=e[r];"\n"===i||"\r\n"===i?n.push(Lr()):"\t"===i?n.push(Xr()):i.length>0&&n.push(yu(i,t))}}else{const{content:e,alias:t}=r;"string"==typeof e?n.push(...Nu([e],"prefix"===r.type&&"string"==typeof t?t:r.type)):Array.isArray(e)&&n.push(...Nu(e,"unchanged"===r.type?void 0:r.type))}return n}const Au={$tokenize(e,t){return Tu(e,t||this.defaultLanguage)},defaultLanguage:"javascript",tokenize(e,t){return vu.tokenize(e,vu.languages[t||""]||vu.languages[this.defaultLanguage])}};function Lu(e,t,n){const r=e.getParent();lu(r)?Iu(r,t,n):_u(e)&&e.replace(Vr(e.__text))}function Pu(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let s="1",o=1;for(let e=0;e<i;e++)Pr(r[e])&&(s+="\n"+ ++o);n.setAttribute("data-gutter",s)}const Ou=new Set;function Iu(e,t,n){const r=e.getKey();void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage);if(!function(e){const t=function(e){const t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e),n=t||e;try{return!!n&&vu.languages.hasOwnProperty(n)}catch(e){return!1}}(e.getLanguage()||n.defaultLanguage))return e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!1),void async function(){}();e.getIsSyntaxHighlightSupported()||e.setIsSyntaxHighlightSupported(!0),Ou.has(r)||(Ou.add(r),t.update((()=>{!function(e,t){const n=Vs(e);if(!lu(n)||!n.isAttached())return;const r=vi();if(!si(r))return void t();const i=r.anchor,s=i.offset,o="element"===i.type&&Pr(n.getChildAtIndex(i.offset-1));let a=0;if(!o){const e=i.getNode();a=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(o?i.getNode().select(s,s):n.getChildren().some((e=>{const t=Jr(e);if(t||Pr(e)){const n=e.getTextContentSize();if(t&&n>=a)return e.select(a,a),!0;a-=n}return!1})))}(r,(()=>{const t=Vs(r);if(!lu(t)||!t.isAttached())return!1;const i=t.getLanguage()||n.defaultLanguage,s=n.$tokenize(t,i),o=function(e,t){let n=0;for(;n<e.length&&Fu(e[n],t[n]);)n++;const r=e.length,i=t.length,s=Math.min(r,i)-n;let o=0;for(;o<s;)if(o++,!Fu(e[r-o],t[i-o])){o--;break}const a=r-o;return{from:n,nodesForReplacement:t.slice(n,i-o),to:a}}(t.getChildren(),s),{from:a,to:l,nodesForReplacement:c}=o;return!(a===l&&!c.length||(e.splice(a,l-a,c),0))}))}),{onUpdate:()=>{Ou.delete(r)},skipTransforms:!0}))}function Fu(e,t){return _u(e)&&_u(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Qr(e)&&Qr(t)||Pr(e)&&Pr(t)}function Ru(e){if(!si(e))return!1;const t=e.anchor.getNode(),n=lu(t)?t:t.getParent(),r=e.focus.getNode(),i=lu(r)?r:r.getParent();return lu(n)&&n.is(i)}function Du(e){const t=e.getNodes(),n=[];if(1===t.length&&lu(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];_u(i)||Qr(i)||Pr(i)||tu(169),Pr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=ti(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function Mu(e){const t=vi();if(!si(t)||!Ru(t))return!1;const n=Du(t),r=n.length;if(0===r&&t.isCollapsed())return e===En&&t.insertNodes([Xr()]),!0;if(0===r&&e===En&&"\n"===t.getTextContent()){const e=Xr(),n=Lr(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),Ia(Wa(wa(ma(e,"next",0),$a(fa(n,"next"))),r)),!0}for(let i=0;i<r;i++){const r=n[i];if(r.length>0){let n=r[0];if(0===i&&(n=xu(n)),e===En){const e=Xr();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=ti(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Qr(n)&&n.remove()}}return!0}function zu(e,t){const n=vi();if(!si(n))return!1;const{anchor:r,focus:i}=n,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),c=e===yn;if(!Ru(n)||!_u(a)&&!Qr(a)||!_u(l)&&!Qr(l))return!1;if(!t.altKey){if(n.isCollapsed()){const e=a.getParentOrThrow();if(c&&0===s&&null===a.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!c&&s===a.getTextContentSize()&&null===a.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(a.isBefore(l)?(u=xu(a),d=ku(l)):(u=xu(l),d=ku(a)),null==u||null==d)return!1;const h=u.getNodesBetween(d);for(let e=0;e<h.length;e++){const t=h[e];if(!_u(t)&&!Qr(t)&&!Pr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!Pr(g))return!0;const p=c?g.getPreviousSibling():g.getNextSibling();if(null==p)return!0;const f=_u(p)||Qr(p)||Pr(p)?c?xu(p):ku(p):null;let m=null!=f?f:p;return g.remove(),h.forEach((e=>e.remove())),e===yn?(h.forEach((e=>m.insertBefore(e))),m.insertBefore(g)):(m.insertAfter(g),m=g,h.forEach((e=>{m.insertAfter(e),m=e}))),n.setTextNodeRange(a,s,l,o),!0}function Bu(e,t){const n=vi();if(!si(n))return!1;const{anchor:r,focus:i}=n,s=r.getNode(),o=i.getNode(),a=e===mn;if(!Ru(n)||!_u(s)&&!Qr(s)||!_u(o)&&!Qr(o))return!1;const l=o;if("rtl"===function(e){const t=xu(e),n=ku(e);let r=t;for(;null!==r;){if(_u(r)){const e=Ds(r.getTextContent());if(null!==e)return e}if(r===n)break;r=r.getNextSibling()}const i=t.getParent();if(ss(i)){const e=i.getDirection();if("ltr"===e||"rtl"===e)return e}return null}(l)?!a:a){const e=function(e,t){let n=null,r=null,i=e,s=t,o=e.getTextContent();for(;;){if(0===s){if(i=i.getPreviousSibling(),null===i)break;if(_u(i)||Qr(i)||Pr(i)||tu(167),Pr(i)){n={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const e=o[s];_u(i)&&" "!==e&&(r={node:i,offset:s})}if(null!==r)return r;let a=null;if(t<e.getTextContentSize())_u(e)&&(a=e.getTextContent()[t]);else{const t=e.getNextSibling();_u(t)&&(a=t.getTextContent()[0])}if(null!==a&&" "!==a)return n;{const r=function(e,t){let n=e,r=t,i=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!_u(n)||r===s){if(n=n.getNextSibling(),null===n||Pr(n))return null;_u(n)&&(r=0,i=n.getTextContent(),s=n.getTextContentSize())}if(_u(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}(l,i.offset);if(null!==e){const{node:t,offset:r}=e;Pr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else l.getParentOrThrow().selectStart()}else(function(e){const t=ku(e);return Pr(t)&&tu(168),t})(l).select();return t.preventDefault(),t.stopPropagation(),!0}const $u=new Set(["http:","https:","mailto:","sms:","tel:"]);let Uu=class e extends is{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:s=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=s}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),pl(t,e.theme.link),t}updateLinkDOM(e,t,n){if(zo(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const n of["target","rel","title"]){const r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:Hu,priority:1})}}static importJSON(e){return Wu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Yu(e);try{const t=new URL(Yu(e));if(!$u.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=Wu(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!si(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function Hu(e){let t=null;if(zo(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=Wu(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Wu(e="",t){return Io(new Uu(e,t))}function Ku(e){return e instanceof Uu}class qu extends Uu{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new qu(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return ju().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(ss(n)){const e=ju(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}}function ju(e="",t){return Io(new qu(e,t))}function Gu(e){return e instanceof qu}function Vu(e,t){if("element"===e.type){const n=e.getNode();return ss(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Ju(e,t={}){let n;if(e&&"object"==typeof e){const{url:r,...i}=e;n=r,t={...i,...t}}else n=e;const{target:r,title:i}=t,s=void 0===t.rel?"noreferrer":t.rel,o=vi();if(null===o||!si(o)&&!ai(o))return;if(ai(o)){const e=o.getNodes();if(0===e.length)return;return void e.forEach((e=>{if(null===n){const t=ea(e,(e=>!Gu(e)&&Ku(e)));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=ea(e,(e=>!Gu(e)&&Ku(e)));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==s&&t.setRel(s);else{const t=Wu(n,{rel:s,target:r});e.insertBefore(t),t.append(e)}}}))}const a=o.extract();if(null===n){const e=new Set;return void a.forEach((t=>{const n=t.getParent();if(Ku(n)&&!Gu(n)){const t=n.getKey();if(e.has(t))return;!function(e,t){const n=new Set(t.filter((t=>e.isParentOf(t))).map((e=>e.getKey()))),r=e.getChildren(),i=r.filter((e=>n.has(e.getKey())));if(i.length===r.length)return r.forEach((t=>e.insertBefore(t))),void e.remove();const s=r.findIndex((e=>n.has(e.getKey()))),o=r.findLastIndex((e=>n.has(e.getKey()))),a=0===s,l=o===r.length-1;if(a)i.forEach((t=>e.insertBefore(t)));else if(l)for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);else{for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);const t=r.slice(o+1);if(t.length>0){const n=Wu(e.getURL(),{rel:e.getRel(),target:e.getTarget(),title:e.getTitle()});i[i.length-1].insertAfter(n),t.forEach((e=>n.append(e)))}}}(n,a),e.add(t)}}))}const l=new Set,c=e=>{l.has(e.getKey())||(l.add(e.getKey()),e.setURL(n),void 0!==r&&e.setTarget(r),void 0!==s&&e.setRel(s),void 0!==i&&e.setTitle(i))};if(1===a.length){const e=a[0],t=ea(e,Ku);if(null!==t)return c(t)}!function(e){const t=vi();if(!si(t))return e();const n=ft(t),r=n.isBackward(),i=Vu(n.anchor,r?-1:0),s=Vu(n.focus,r?0:-1);if(e(),i||s){const e=vi();if(si(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(s){const e=s.getParent();e&&t.focus.set(e.getKey(),s.getIndexWithinParent()+(r?0:1),"element")}no(ft(t))}}}((()=>{let e=null;for(const t of a){if(!t.isAttached())continue;const o=ea(t,Ku);if(o){c(o);continue}if(ss(t)){if(!t.isInline())continue;if(Ku(t)){if(!(Gu(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(const e of t.getChildren())t.insertBefore(e);t.remove();continue}}const a=t.getPreviousSibling();Ku(a)&&a.is(e)?a.append(t):(e=Wu(n,{rel:s,target:r,title:i}),t.insertAfter(e),e.append(t))}}))}const Zu=/^\+?[0-9\s()-]{5,}$/;function Yu(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Zu.test(e)?`tel:${e}`:`https://${e}`}function Xu(e){let t=e;for(;null!==t;){if(ic(t))return t;t=t.getParent()}return null}function Qu(e){let t=e;for(;t;){if(dc(t))return t.getListType();t=t.getParent()}return null}function ed(e,t=e=>e){return td(Br,e,((e,n)=>({...e,forChild:(r,i)=>{const s=e?.forChild??(e=>e);let o=s(r,i);return Jr(o)&&(o=t(o,n)??o),o}})))}function td(e,t,n=e=>e){return r=>{const i=e.importDOM()?.[t]?.(r);if(!i)return null;const s=i.conversion(r);return s?n(s,r)??s:s}}function nd(e){const t="string"==typeof e?ja(e):e;return!(!t.color&&!t["background-color"])}class rd extends HTMLElement{static observedAttributes=["connected"];constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar"}connectedCallback(){requestAnimationFrame((()=>this.#e())),this._resizeObserver=new ResizeObserver((()=>this.#e())),this._resizeObserver.observe(this)}disconnectedCallback(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this.#t()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#n()))}setEditor(e){this.editorElement=e,this.editor=e.editor,this.#r(),this.#i(),this.#s(),this.#o(),this.#a(),this.#l(),this.#e(),this.toggleAttribute("connected",!0)}#n(){this.disconnectedCallback(),this.connectedCallback()}#r(){this.addEventListener("click",this.#c.bind(this))}#c({target:e}){this.#u(e,"[data-command]",this.#d.bind(this))}#u(e,t,n){const r=e.closest(t);r&&n(r)}#d(e){const{command:t,payload:n}=e.dataset;this.editor.dispatchCommand(t,n)}#i(){this.editorElement.addEventListener("keydown",this.#h)}#t(){this.editorElement?.removeEventListener("keydown",this.#h)}#h=e=>{this.querySelectorAll("[data-hotkey]").forEach((t=>{t.dataset.hotkey.toLowerCase().split(/\s+/).includes(this.#g(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))};#g(e){const t=e.key.toLowerCase();return[...[e.ctrlKey?"ctrl":null,e.metaKey?"cmd":null,e.altKey?"alt":null,e.shiftKey?"shift":null].filter(Boolean),t].join("+")}#s(){this.#p.forEach((e=>{e.setAttribute("tabindex",0)}))}#a(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{this.#f()}))}))}#l(){this.editor.registerUpdateListener((()=>{this.#m()}))}#m(){this.editor.getEditorState().read((()=>{const e=this.editorElement.historyState;e&&(this.#y("undo",0===e.undoStack.length),this.#y("redo",0===e.redoStack.length))}))}#f(){const e=vi();if(!si(e))return;const t=e.anchor.getNode();if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e.hasFormat("bold"),i=e.hasFormat("italic"),s=e.hasFormat("strikethrough"),o=function(e){return!!si(e)&&(e.isCollapsed()?nd(e.style):e.hasFormat("highlight"))}(e),a=this.#_(t),l=Hc(n),c=Vc(n),u=lu(n)||e.hasFormat("code"),d=this.#b(t),h=Qu(t);this.#x("bold",r),this.#x("italic",i),this.#x("strikethrough",s),this.#x("highlight",o),this.#x("link",a),this.#x("quote",l),this.#x("heading",c),this.#x("code",u),this.#x("unordered-list",d&&"bullet"===h),this.#x("ordered-list",d&&"number"===h),this.#m()}#b(e){let t=e;for(;t;){if(dc(t)||ic(t))return!0;t=t.getParent()}return!1}#_(e){let t=e;for(;t;){if(Ku(t))return!0;t=t.getParent()}return!1}#x(e,t){const n=this.querySelector(`[name="${e}"]`);n&&n.setAttribute("aria-pressed",t.toString())}#y(e,t){const n=this.querySelector(`[name="${e}"]`);n&&(n.disabled=t,n.setAttribute("aria-disabled",t.toString()))}#k(){return this.scrollWidth>this.clientWidth}#e=()=>{this.#v(),this.#S(),this.#w.style.display=this.#C.children.length?"block":"none",this.#w.setAttribute("nonce",cl());const e=this.#C.children.length>0;this.toggleAttribute("overflowing",e)};#S(){const e=this.#p.reverse();let t=!1;for(const n of e){if(!this.#k()){t&&this.#C.prepend(n);break}this.#C.prepend(n),t=!0}}#v(){const e=Array.from(this.#C.children);e.sort(((e,t)=>this.#E(t)-this.#E(e))),e.forEach((e=>{const t=this.querySelector(`[data-position="${this.#E(e)+1}"]`)??this.#w;this.insertBefore(e,t)}))}#E(e){return parseInt(e.dataset.position??"999")}#o(){this.#T.forEach(((e,t)=>{void 0===e.dataset.position&&(e.dataset.position=t)}))}get#w(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#C(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")}get#p(){return Array.from(this.querySelectorAll(":scope > button"))}get#T(){return Array.from(this.querySelectorAll(":scope > *:not(.lexxy-editor__toolbar-overflow)"))}static get defaultTemplate(){return'\n <button class="lexxy-editor__toolbar-button" type="button" name="bold" data-command="bold" title="Bold">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 22V2h8.183c1.764 0 3.174.435 4.228 1.304 1.055.87 1.582 2.076 1.582 3.62 0 .8-.148 1.503-.445 2.109a3.94 3.94 0 01-1.194 1.465 4.866 4.866 0 01-1.726.806v.176c.786.078 1.51.312 2.172.703a4.293 4.293 0 011.596 1.627c.403.693.604 1.543.604 2.549 0 1.192-.292 2.207-.877 3.048-.585.84-1.39 1.484-2.416 1.934-1.026.44-2.206.659-3.538.659H5zM8.854 4.974v5.348h2.56c.873 0 1.582-.107 2.129-.322.556-.215.963-.523 1.222-.923.269-.41.403-.904.403-1.48 0-.82-.254-1.46-.762-1.92-.499-.468-1.204-.703-2.115-.703H8.854zm0 8.103v5.949h2.877c1.534 0 2.636-.245 3.307-.733.671-.498 1.007-1.221 1.007-2.168 0-.635-.134-1.178-.403-1.627-.268-.459-.666-.81-1.193-1.055-.518-.244-1.156-.366-1.913-.366H8.854z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="italic" data-command="italic" title="Italic">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.1 4h-1.5l-3.2 16h1.5l-.4 2h-7l.4-2h1.5l3.2-16h-1.5l.4-2h7l-.4 2z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="strikethrough" data-command="strikethrough" title="Strikethrough">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.70588 16.1591C4.81459 19.7901 7.48035 22 11.6668 22C15.9854 22 18.724 19.6296 18.724 15.8779C18.724 15.5007 18.6993 15.1427 18.6474 14.8066H14.3721C14.8637 15.2085 15.0799 15.7037 15.0799 16.3471C15.0799 17.7668 13.7532 18.7984 11.8113 18.7984C9.88053 18.7984 8.38582 17.7531 8.21659 16.1591H4.70588ZM5.23953 9.31962H9.88794C9.10723 8.88889 8.75888 8.33882 8.75888 7.57339C8.75888 6.13992 9.96576 5.18793 11.7631 5.18793C13.5852 5.18793 14.8761 6.1797 14.9959 7.81344H18.4102C18.3485 4.31824 15.8038 2 11.752 2C7.867 2 5.09129 4.35802 5.09129 7.92044C5.09129 8.41838 5.14071 8.88477 5.23953 9.31962ZM2.23529 10.6914C1.90767 10.6914 1.59347 10.8359 1.36181 11.0931C1.13015 11.3504 1 11.6993 1 12.0631C1 12.4269 1.13015 12.7758 1.36181 13.0331C1.59347 13.2903 1.90767 13.4348 2.23529 13.4348H20.7647C21.0923 13.4348 21.4065 13.2903 21.6382 13.0331C21.8699 12.7758 22 12.4269 22 12.0631C22 11.6993 21.8699 11.3504 21.6382 11.0931C21.4065 10.8359 21.0923 10.6914 20.7647 10.6914H2.23529Z"/>\n </svg>\n </button>\n\n <details class="lexxy-editor__toolbar-dropdown" name="lexxy-dropdown">\n <summary class="lexxy-editor__toolbar-button" name="highlight" title="Color highlight">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.65422 0.711575C7.1856 0.242951 6.42579 0.242951 5.95717 0.711575C5.48853 1.18021 5.48853 1.94 5.95717 2.40864L8.70864 5.16011L2.85422 11.0145C1.44834 12.4204 1.44833 14.6998 2.85422 16.1057L7.86011 21.1115C9.26599 22.5174 11.5454 22.5174 12.9513 21.1115L19.6542 14.4087C20.1228 13.94 20.1228 13.1802 19.6542 12.7115L11.8544 4.91171L11.2542 4.31158L7.65422 0.711575ZM4.55127 12.7115L10.4057 6.85716L17.1087 13.56H4.19981C4.19981 13.253 4.31696 12.9459 4.55127 12.7115ZM23.6057 20.76C23.6057 22.0856 22.5311 23.16 21.2057 23.16C19.8802 23.16 18.8057 22.0856 18.8057 20.76C18.8057 19.5408 19.8212 18.5339 20.918 17.4462C21.0135 17.3516 21.1096 17.2563 21.2057 17.16C21.3018 17.2563 21.398 17.3516 21.4935 17.4462C22.5903 18.5339 23.6057 19.5408 23.6057 20.76Z"/></svg>\n </summary>\n <lexxy-highlight-dropdown class="lexxy-editor__toolbar-dropdown-content">\n <div data-button-group="color" data-values="var(--highlight-1); var(--highlight-2); var(--highlight-3); var(--highlight-4); var(--highlight-5); var(--highlight-6); var(--highlight-7); var(--highlight-8); var(--highlight-9)"></div>\n <div data-button-group="background-color" data-values="var(--highlight-bg-1); var(--highlight-bg-2); var(--highlight-bg-3); var(--highlight-bg-4); var(--highlight-bg-5); var(--highlight-bg-6); var(--highlight-bg-7); var(--highlight-bg-8); var(--highlight-bg-9)"></div>\n <button data-command="removeHighlight" class="lexxy-editor__toolbar-dropdown-reset">Remove all coloring</button>\n </lexxy-highlight-dropdown>\n </details>\n\n <details class="lexxy-editor__toolbar-dropdown" name="lexxy-dropdown">\n <summary class="lexxy-editor__toolbar-button" name="link" title="Link" data-hotkey="cmd+k ctrl+k">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.111 9.546a1.5 1.5 0 012.121 0 5.5 5.5 0 010 7.778l-2.828 2.828a5.5 5.5 0 01-7.778 0 5.498 5.498 0 010-7.777l2.828-2.83a1.5 1.5 0 01.355-.262 6.52 6.52 0 00.351 3.799l-1.413 1.414a2.499 2.499 0 000 3.535 2.499 2.499 0 003.535 0l2.83-2.828a2.5 2.5 0 000-3.536 1.5 1.5 0 010-2.121z"/><path d="M12.111 3.89a5.5 5.5 0 117.778 7.777l-2.828 2.829a1.496 1.496 0 01-.355.262 6.522 6.522 0 00-.351-3.8l1.413-1.412a2.5 2.5 0 10-3.536-3.535l-2.828 2.828a2.5 2.5 0 000 3.536 1.5 1.5 0 01-2.122 2.12 5.5 5.5 0 010-7.777l2.83-2.829z"/></svg>\n </summary>\n <lexxy-link-dropdown class="lexxy-editor__toolbar-dropdown-content">\n <form method="dialog">\n <input type="url" placeholder="Enter a URL…" class="input">\n <div class="lexxy-editor__toolbar-dropdown-actions">\n <button type="submit" class="btn" value="link">Link</button>\n <button type="button" class="btn" value="unlink">Unlink</button>\n </div>\n </form>\n </lexxy-link-dropdown>\n </details>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="quote" data-command="insertQuoteBlock" title="Quote">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.5 5C8.985 5 11 7.09 11 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.022.746a.563.563 0 01-.52-.36.602.602 0 01.067-.57l.055-.066.009-.009.041-.048a4.25 4.25 0 00.168-.21c.143-.188.336-.47.53-.84a6.743 6.743 0 00.75-2.605C3.705 13.994 2 12.038 2 9.667 2 7.089 4.015 5 6.5 5zM17.5 5C19.985 5 22 7.09 22 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.023.746a.563.563 0 01-.52-.36.602.602 0 01.068-.57l.055-.066.009-.009.041-.048c.039-.045.097-.115.168-.21a6.16 6.16 0 00.53-.84 6.745 6.745 0 00.75-2.605C14.705 13.994 13 12.038 13 9.667 13 7.089 15.015 5 17.5 5z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="heading" data-command="rotateHeadingFormat" title="Heading">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M15.322 5.315H9.64V22H5.684V5.315H0v-3.31h15.322v3.31z"/><path d="M23.957 11.79H19.92V22h-3.402V11.79H12.48V9.137h11.477v2.653z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="code" data-command="insertCodeBlock" title="Code">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.121 6l-6 6 6 6-2.12 2.121-7.061-7.06a1.5 1.5 0 010-2.121L8 3.879 10.121 6zM23.06 10.94a1.5 1.5 0 010 2.12L16 20.121 13.88 18l6-6-6-6L16 3.879l7.06 7.06z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="unordered-list" data-command="insertUnorderedList" title="Bullet list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 5a2 2 0 11-4 0 2 2 0 014 0zM5 12a2 2 0 11-4 0 2 2 0 014 0zM5 19a2 2 0 11-4 0 2 2 0 014 0zM7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="ordered-list" data-command="insertOrderedList" title="Numbered list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM4.438 8H3.39V3.684H3.34c-.133.093-.267.188-.402.285l-.407.289a129.5 129.5 0 00-.402.285v-.969l.633-.453c.21-.15.42-.302.629-.453h1.046V8zM2.672 11.258h-1v-.051c0-.206.036-.405.11-.598.075-.195.188-.37.34-.527.15-.156.339-.281.566-.375.229-.094.498-.14.808-.14.367 0 .688.065.961.195s.484.308.633.535c.15.224.226.478.226.762 0 .244-.046.463-.14.656-.091.19-.209.368-.352.535-.14.164-.289.332-.445.504L3.168 14.09v.05h2.238V15H1.723v-.656l1.949-2.102c.096-.101.19-.207.281-.316.091-.112.167-.232.227-.36a.953.953 0 00.09-.41.712.712 0 00-.387-.648.845.845 0 00-.41-.098.81.81 0 00-.43.11.75.75 0 00-.277.293.824.824 0 00-.094.386V11.258zM2.852 19.66v-.812h.562a.917.917 0 00.43-.098.742.742 0 00.293-.266.673.673 0 00.101-.379.654.654 0 00-.234-.523.87.87 0 00-.59-.2.987.987 0 00-.336.055.837.837 0 00-.258.149.712.712 0 00-.172.215.66.66 0 00-.066.25h-.98c.007-.209.053-.403.136-.582.084-.18.203-.336.36-.469.156-.135.346-.24.57-.316.227-.076.486-.115.777-.118a2.33 2.33 0 01.965.176c.271.12.48.285.63.496.15.209.227.448.23.719a1.11 1.11 0 01-.16.637 1.28 1.28 0 01-.825.586v.054c.162.016.33.07.504.164.177.094.328.232.453.415.125.18.189.411.192.695a1.37 1.37 0 01-.157.676c-.104.197-.25.365-.437.503-.188.136-.404.24-.649.313-.242.07-.5.105-.777.105-.401 0-.743-.067-1.027-.203a1.608 1.608 0 01-.649-.547 1.46 1.46 0 01-.238-.75h.969c.01.128.057.243.14.344a.885.885 0 00.332.238c.141.058.3.088.477.09.195 0 .366-.034.512-.101a.798.798 0 00.336-.29.744.744 0 00.117-.425.74.74 0 00-.446-.695 1.082 1.082 0 00-.496-.106h-.59z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="upload" data-command="uploadAttachments" title="Upload file">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 8a2 2 0 110 4 2 2 0 010-4z""/><path d="M22 2a1 1 0 011 1v18a1 1 0 01-1 1H2a1 1 0 01-1-1V3a1 1 0 011-1h20zM3 18.714L9 11l5.25 6.75L17 15l4 4V4H3v14.714z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="divider" data-command="insertHorizontalDivider" title="Insert a divider">\n <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 12C0 11.4477 0.447715 11 1 11H23C23.5523 11 24 11.4477 24 12C24 12.5523 23.5523 13 23 13H1C0.447716 13 0 12.5523 0 12Z"/><path d="M4 5C4 3.89543 4.89543 3 6 3H18C19.1046 3 20 3.89543 20 5C20 6.10457 19.1046 7 18 7H6C4.89543 7 4 6.10457 4 5Z"/><path d="M4 19C4 17.8954 4.89543 17 6 17H18C19.1046 17 20 17.8954 20 19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19Z"/></svg>\n </button>\n \n <div class="lexxy-editor__toolbar-spacer" role="separator"></div>\n \n <button class="lexxy-editor__toolbar-button" type="button" name="undo" data-command="undo" title="Undo" data-hotkey="cmd+z ctrl+z">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5.64648 8.26531C7.93911 6.56386 10.7827 5.77629 13.624 6.05535C16.4655 6.33452 19.1018 7.66079 21.0195 9.77605C22.5839 11.5016 23.5799 13.6516 23.8936 15.9352C24.0115 16.7939 23.2974 17.4997 22.4307 17.4997C21.5641 17.4997 20.8766 16.7915 20.7148 15.9401C20.4295 14.4379 19.7348 13.0321 18.6943 11.8844C17.3 10.3464 15.3835 9.38139 13.3174 9.17839C11.2514 8.97546 9.18359 9.54856 7.5166 10.7858C6.38259 11.6275 5.48981 12.7361 4.90723 13.9997H8.5C9.3283 13.9997 9.99979 14.6714 10 15.4997C10 16.3281 9.32843 16.9997 8.5 16.9997H1.5C0.671573 16.9997 0 16.3281 0 15.4997V8.49968C0.000213656 7.67144 0.671705 6.99968 1.5 6.99968C2.3283 6.99968 2.99979 7.67144 3 8.49968V11.0212C3.7166 9.9704 4.60793 9.03613 5.64648 8.26531Z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="redo" data-command="redo" title="Redo" data-hotkey="cmd+shift+z ctrl+shift+z ctrl+y">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.2599 8.26531C15.9672 6.56386 13.1237 5.77629 10.2823 6.05535C7.4408 6.33452 4.80455 7.66079 2.88681 9.77605C1.32245 11.5016 0.326407 13.6516 0.0127834 15.9352C-0.105117 16.7939 0.608975 17.4997 1.47567 17.4997C2.34228 17.4997 3.02969 16.7915 3.19149 15.9401C3.47682 14.4379 4.17156 13.0321 5.212 11.8844C6.60637 10.3464 8.52287 9.38139 10.589 9.17839C12.655 8.97546 14.7227 9.54856 16.3897 10.7858C17.5237 11.6275 18.4165 12.7361 18.9991 13.9997H15.4063C14.578 13.9997 13.9066 14.6714 13.9063 15.4997C13.9063 16.3281 14.5779 16.9997 15.4063 16.9997H22.4063C23.2348 16.9997 23.9063 16.3281 23.9063 15.4997V8.49968C23.9061 7.67144 23.2346 6.99968 22.4063 6.99968C21.578 6.99968 20.9066 7.67144 20.9063 8.49968V11.0212C20.1897 9.9704 19.2984 9.03613 18.2599 8.26531Z"/></svg>\n </button>\n\n <details class="lexxy-editor__toolbar-overflow">\n <summary class="lexxy-editor__toolbar-button" aria-label="Show more toolbar buttons">•••</summary>\n <div class="lexxy-editor__toolbar-overflow-menu" aria-label="More toolbar buttons"></div>\n </details>\n '}}function id(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}customElements.define("lexxy-toolbar",rd),function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism),function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:i,punctuation:s};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},a=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];e.languages.insertBefore("php","variable",{string:a,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:a,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:i,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){if(/<\?/.test(t.code)){e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(Prism),Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"],function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],s=r.variable[1].inside,o=0;o<i.length;o++)s[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash}(Prism),Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const sd=/[!-/:-@[-`{-~\s]/;function od(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ad=function(e,t){return new et(e,t)}("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-"}),ld=e=>(t,n,r,i)=>{const s=e(r);s.append(...n),t.replace(s),i||s.select(0,0)},cd=e=>(t,n,r,i)=>{const s=t.getPreviousSibling(),o=t.getNextSibling(),a=rc("check"===e?"x"===r[3]:void 0),l=r[0].trim()[0],c="bullet"!==e&&"check"!==e||l!==ad.parse(l)?void 0:l;if(dc(o)&&o.getListType()===e){c&&nt(o,ad,c);const e=o.getFirstChild();null!==e?e.insertBefore(a):o.append(a),t.remove()}else if(dc(s)&&s.getListType()===e)c&&nt(s,ad,c),s.append(a),t.remove();else{const n=uc(e,"number"===e?Number(r[2]):void 0);c&&nt(n,ad,c),n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const u=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&a.setIndent(u)},ud=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const o of i)if(ic(o)){if(1===o.getChildrenSize()){const e=o.getFirstChild();if(dc(e)){r.push(ud(e,t,n+1));continue}}const i=" ".repeat(4*n),a=e.getListType(),l=tt(e,ad),c="number"===a?`${e.getStart()+s}. `:"check"===a?`${l} [${o.getChecked()?"x":" "}] `:l+" ";r.push(i+c+t(o)),s++}return r.join("\n")},dd={dependencies:[Wc],export:(e,t)=>{if(!Vc(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:ld((e=>Gc("h"+e[1].length))),type:"element"},hd={dependencies:[$c],export:(e,t)=>{if(!Hc(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(Hc(n))return n.splice(n.getChildrenSize(),0,[Lr(),...t]),void e.remove()}const i=Uc();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},gd={dependencies:[ou],export:e=>{if(!lu(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:/[ \t]*```$/},regExpStart:/^[ \t]*```([\w-]+)?/,replace:(e,t,n,r,i,s)=>{let o,a;if(!t&&i){if(1===i.length)r?(o=au(),a=n[1]+i[0]):(o=au(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=au(n[1]),0===i[0].trim().length)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();a=i.join("\n")}const t=Vr(a);o.append(t),e.append(o)}else t&&ld((e=>au(e?e[1]:void 0)))(e,t,n,s)},type:"multiline-element"},pd={dependencies:[sc,ec],export:(e,t)=>dc(e)?ud(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:cd("bullet"),type:"element"},fd={dependencies:[sc,ec],export:(e,t)=>dc(e)?ud(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:cd("number"),type:"element"},md={dependencies:[Uu],export:(e,t,n)=>{if(!Ku(e)||Gu(e))return null;const r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,i]=t,s=Wu(r,{title:i}),o=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(o<a)return;if(o>a){const e=n.split("[");c="["+e[0],l=e.slice(1).join("[")}const u=Vr(l);return u.setFormat(e.getFormat()),s.append(u),e.replace(s),c&&s.insertBefore(Vr(c)),u},trigger:")",type:"text-match"},yd=[...[dd,hd,pd,fd],...[gd],...[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],...[md]];function _d(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(bd(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function bd(e,t,n,r,i){for(let s=0;s<i;s++)if(e[t+s]!==n[r+s])return!1;return!0}function xd(e,t=yd){const n=function(e){const t=id(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}(t),r=id(n.textFormat,(({tag:e})=>e[e.length-1])),i=id(n.textMatch,(({trigger:e})=>e));for(const n of t){const t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=n.dependencies;for(const n of t)e.hasNode(n)||od(173,n.getType())}}const s=(e,t,s)=>{(function(e,t,n,r){if(!Oo(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExp:s,replace:o}of r){const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,!1))return s.remove(),!0}}return!1})(e,t,s,n.element)||function(e,t,n,r){if(!Oo(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExpStart:s,replace:o,regExpEnd:a}of r){if(a&&!("optional"in a)||a&&"optional"in a&&!a.optional)continue;const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,null,null,!1))return s.remove(),!0}}return!1}(e,t,s,n.multilineElement)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const t of i){if(!t.replace||!t.regExp)continue;const n=r.match(t.regExp);if(null===n)continue;const i=n.index||0,s=i+n[0].length;let o;return 0===i?[o]=e.splitText(s):[,o]=e.splitText(i,s),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,s,i)||function(e,t,n){const r=e.getTextContent(),i=t-1,s=r[i],o=n[s];if(!o)return!1;for(const t of o){const{tag:n}=t,o=n.length,a=i-o+1;if(o>1&&!bd(r,a,n,0,o))continue;if(" "===r[a-1])continue;const l=r[i+1];if(!1===t.intraword&&l&&!sd.test(l))continue;const c=e;let u=c,d=_d(r,a,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!Pr(h);)if(Jr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=_d(e,e.length,n)}if(d<0)continue;if(u===c&&d+o===a)continue;const g=u.getTextContent();if(d>0&&g[d-1]===s)continue;const p=g[d-1];if(!1===t.intraword&&p&&!sd.test(p))continue;const f=c.getTextContent(),m=f.slice(0,a)+f.slice(i+1);c.setTextContent(m);const y=u===c?m:g;u.setTextContent(y.slice(0,d)+y.slice(d+o));const _=vi(),b=bi();no(b);const x=i-o*(u===c?2:1)+1;b.anchor.set(u.__key,d,"text"),b.focus.set(c.__key,x,"text");for(const e of t.format)b.hasFormat(e)||b.formatText(e);b.anchor.set(b.focus.key,b.focus.offset,b.focus.type);for(const e of t.format)b.hasFormat(e)&&b.toggleFormat(e);return si(_)&&(b.format=_.format),!0}}(t,s,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(wr)||t.has(vr))return;if(e.isComposing())return;const o=r.read(vi),a=i.read(vi);if(!si(a)||!si(o)||!o.isCollapsed()||o.is(a))return;const l=o.anchor.key,c=o.anchor.offset,u=r._nodeMap.get(l);!Jr(u)||!n.has(l)||1!==c&&c>a.anchor.offset+1||e.update((()=>{if(!function(e){return Jr(e)&&!e.hasFormat("code")}(u))return;const e=u.getParent();null===e||lu(e)||s(e,u,o.anchor.offset)}))}))}function kd(e,t){let n=Date.now(),r=0;return(i,s,o,a,l,c)=>{const u=Date.now();if(c.has(vr))return r=0,n=u,2;const d=function(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const s=t._selection,o=e._selection;if(i)return 1;if(!(si(s)&&si(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const e of t){const t=r.get(e);void 0!==t&&i.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||us(n)||i.push(n)}return i}(t,n,r);if(0===a.length)return 0;if(a.length>1){const n=t._nodeMap,r=n.get(s.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Jr(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Jr(c)||!Jr(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=s.anchor,g=o.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,f=g.offset,m=d.length-u.length;return 1===m&&f===p-1?2:-1===m&&f===p+1?3:-1===m&&f===p?4:0}(i,s,a,l,e.isComposing()),h=(()=>{const h=null===o||o.editor===e,g=c.has("history-push");if(!g&&h&&c.has(Sr))return 0;if(null===i)return 1;const p=s._selection;if(!(a.size>0||l.size>0))return null!==p?0:2;const f="number"==typeof t?t:t.peek();return!1===g&&0!==d&&d===r&&u<n+f&&h||1===a.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),s=t._selection,o=n._selection;return!(si(s)&&si(o)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===o.anchor.type&&"text"===o.focus.type||!Jr(r)||!Jr(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(a)[0],i,s)?0:1})();return n=u,r=d,h}}function vd(e){e.undoStack=[],e.redoStack=[],e.current=null}function Sd(e,t,n){const r=kd(e,n),i=gl(e.registerCommand(un,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,s=r.pop();null!==i&&(n.push(i),e.dispatchCommand(zn,!0)),0===r.length&&e.dispatchCommand(Bn,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:vr})}}(e,t),!0)),0),e.registerCommand(dn,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(Bn,!0));const s=n.pop();0===n.length&&e.dispatchCommand(zn,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:vr})}}(e,t),!0)),0),e.registerCommand(Dn,(()=>(vd(t),!1)),0),e.registerCommand(Mn,(()=>(vd(t),e.dispatchCommand(zn,!1),e.dispatchCommand(Bn,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:s,dirtyElements:o,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(i,n,l,s,o,a);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(zn,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Bn,!0));else if(2===h)return;t.current={editor:e,editorState:n}})));return i}function wd(){return{current:null,redoStack:[],undoStack:[]}}var Cd={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",strikethrough:"lexxy-content__strikethrough",underline:"lexxy-content__underline",highlight:"lexxy-content__highlight"},list:{nested:{listitem:"lexxy-nested-listitem"}},codeHighlight:{addition:"code-token__selector",atrule:"code-token__attr",attr:"code-token__attr","attr-name":"code-token__attr","attr-value":"code-token__selector",boolean:"code-token__property",bold:"code-token__variable",builtin:"code-token__selector",cdata:"code-token__comment",char:"code-token__selector",class:"code-token__function","class-name":"code-token__function",color:"code-token__property",comment:"code-token__comment",constant:"code-token__property",coord:"code-token__comment",decorator:"code-token__function",deleted:"code-token__operator",deletion:"code-token__operator",directive:"code-token__attr","directive-hash":"code-token__property",doctype:"code-token__comment",entity:"code-token__operator",function:"code-token__function",hexcode:"code-token__property",important:"code-token__function",inserted:"code-token__selector",italic:"code-token__comment",keyword:"code-token__attr",line:"code-token__selector",namespace:"code-token__variable",number:"code-token__property",macro:"code-token__function",operator:"code-token__operator",parameter:"code-token__variable",prolog:"code-token__comment",property:"code-token__property",punctuation:"code-token__punctuation","raw-string":"code-token__operator",regex:"code-token__variable",script:"code-token__function",selector:"code-token__selector",string:"code-token__selector",style:"code-token__function",symbol:"code-token__property",tag:"code-token__property",title:"code-token__function","type-definition":"code-token__function",url:"code-token__operator",variable:"code-token__variable"}};function Ed(e,t){const n=document.createElement(e);for(const[e,r]of Object.entries(t||{}))e in n?n[e]=r:null!=r&&n.setAttribute(e,r);return n}function Td(e){return(new DOMParser).parseFromString(e,"text/html")}function Nd(e,t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(r)}function Ad(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function Ld(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function Pd(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(2)} ${["B","KB","MB","GB","TB","PB"][t]}`}class Od extends as{static getType(){return"action_text_attachment"}static clone(e){return new Od({...e},e.__key)}static importJSON(e){return new Od({...e})}static importDOM(){return{"action-text-attachment":e=>({conversion:()=>({node:new Od({sgid:e.getAttribute("sgid"),src:e.getAttribute("url"),previewable:e.getAttribute("previewable"),altText:e.getAttribute("alt"),caption:e.getAttribute("caption"),contentType:e.getAttribute("content-type"),fileName:e.getAttribute("filename"),fileSize:e.getAttribute("filesize"),width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),img:e=>({conversion:()=>({node:new Od({src:e.getAttribute("src"),caption:e.getAttribute("alt")||"",contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),video:e=>{const t=e.getAttribute("src")||e.querySelector("source")?.src,n=t?.split("/")?.pop(),r=e.querySelector("source")?.getAttribute("content-type")||"video/*";return{conversion:()=>({node:new Od({src:t,fileName:n,contentType:r})}),priority:1}}}}constructor({sgid:e,src:t,previewable:n,altText:r,caption:i,contentType:s,fileName:o,fileSize:a,width:l,height:c},u){super(u),this.sgid=e,this.src=t,this.previewable=n,this.altText=r||"",this.caption=i||"",this.contentType=s||"",this.fileName=o||"",this.fileSize=a,this.width=l,this.height=c}createDOM(){const e=this.createAttachmentFigure();return e.addEventListener("click",(t=>{this.#N(e)})),this.isPreviewableAttachment?(e.appendChild(this.#A()),e.appendChild(this.#L())):(e.appendChild(this.#P()),e.appendChild(this.#O())),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:Ed("action-text-attachment",{sgid:this.sgid,previewable:this.previewable||null,url:this.src,alt:this.altText,caption:this.caption,"content-type":this.contentType,filename:this.fileName,filesize:this.fileSize,width:this.width,height:this.height,presentation:"gallery"})}}exportJSON(){return{type:"action_text_attachment",version:1,sgid:this.sgid,src:this.src,previewable:this.previewable,altText:this.altText,caption:this.caption,contentType:this.contentType,fileName:this.fileName,fileSize:this.fileSize,width:this.width,height:this.height}}decorate(){return null}createAttachmentFigure(){return e=this.contentType,t=this.isPreviewableAttachment,n=this.fileName,Ed("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e});var e,t,n}get#I(){return(e=this.contentType).startsWith("image/")&&!e.includes("svg");var e}get isPreviewableAttachment(){return this.#I||this.previewable}#A(){return Ed("img",{src:this.src,alt:this.altText,...this.#F})}get#F(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#P(){return Ed("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#O(){const e=Ed("figcaption",{className:"attachment__caption"}),t=Ed("strong",{className:"attachment__name",textContent:this.caption||this.fileName});if(e.appendChild(t),this.fileSize){const t=Ed("span",{className:"attachment__size",textContent:Pd(this.fileSize)});e.appendChild(t)}return e}#N(e){Nd(e,"lexxy:internal:select-node",{key:this.getKey()})}#L(){const e=Ed("figcaption",{className:"attachment__caption"}),t=Ed("textarea",{value:this.caption,placeholder:this.fileName,rows:"1"});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",this.#R.bind(this)),t.addEventListener("keydown",this.#D.bind(this)),e.appendChild(t),e}#R(e){const t=e.target;t.placeholder=this.fileName,this.#M(t)}#M(e){Nd(e,"lexxy:internal:invalidate-node",{key:this.getKey(),values:{caption:e.value}})}#D(e){"Enter"===e.key&&(this.#M(e.target),Nd(e.target,"lexxy:internal:move-to-next-line"),e.preventDefault()),e.stopPropagation()}}class Id extends Od{static getType(){return"action_text_attachment_upload"}static clone(e){return new Id({...e},e.__key)}static importJSON(e){return new Id({...e})}constructor({file:e,uploadUrl:t,blobUrlTemplate:n,editor:r,progress:i},s){super({contentType:e.type},s),this.file=e,this.uploadUrl=t,this.blobUrlTemplate=n,this.src=null,this.editor=r,this.progress=i||0}createDOM(){const e=this.createAttachmentFigure();this.isPreviewableAttachment?e.appendChild(this.#A()):e.appendChild(this.#P()),e.appendChild(this.#z());const t=Ed("progress",{value:this.progress,max:100});return e.appendChild(t),this.#B(e).then((()=>this.#$(t,e))),e}exportDOM(){const e=document.createElement("img");return this.src&&(e.src=this.src),{element:e}}exportJSON(){return{type:"action_text_attachment_upload",version:1,progress:this.progress,uploadUrl:this.uploadUrl,blobUrlTemplate:this.blobUrlTemplate,...super.exportJSON()}}#A(){return Ed("img")}#P(){return Ed("span",{className:"attachment__icon",textContent:this.#U()})}#U(){return this.file.name.split(".").pop().toLowerCase()}#z(){const e=Ed("figcaption",{className:"attachment__caption"}),t=Ed("span",{className:"attachment__name",textContent:this.file.name||""}),n=Ed("span",{className:"attachment__size",textContent:Pd(this.file.size)});return e.appendChild(t),e.appendChild(n),e}#B(e){const t=e.querySelector("img");return t?async function(e,t){return new Promise((n=>{const r=new FileReader;t.addEventListener("load",(()=>{n(t)})),r.onload=e=>{t.src=e.target.result||null},r.readAsDataURL(e)}))}(this.file,t):Promise.resolve()}#$(t,n){const r=new e(this.file,this.uploadUrl,this);r.delegate={directUploadWillStoreFileWithXHR:e=>{e.upload.addEventListener("progress",(e=>{this.editor.update((()=>{t.value=Math.round(e.loaded/e.total*100)}))}))}},r.create(((e,t)=>{e?this.#H(n):this.#W(t,n).then((()=>{this.#K(n,t)}))}))}#H(e){e.innerHTML="",e.classList.add("attachment--error"),e.appendChild(Ed("div",{innerText:`Error uploading ${this.file?.name??"image"}`}))}async#K(e,t){this.editor.update((()=>{const n=e.querySelector("img"),r=this.blobUrlTemplate.replace(":signed_id",t.signed_id).replace(":filename",encodeURIComponent(t.filename)),i=Vs(this.getKey());i&&i.replace(new Od({sgid:t.attachable_sgid,src:t.previewable?t.url:r,altText:t.filename,contentType:t.content_type,fileName:t.filename,fileSize:t.byte_size,width:n?.naturalWidth,previewable:t.previewable,height:n?.naturalHeight}))}),{tag:Sr})}async#W(e,t){return e.previewable?new Promise((n=>{this.editor.update((()=>{const r=this.#A();r.addEventListener("load",(()=>{n()})),r.src=e.url,t.insertBefore(r,t.firstChild)}))})):Promise.resolve()}}class Fd extends as{static getType(){return"horizontal_divider"}static clone(e){return new Fd(e.__key)}static importJSON(e){return new Fd}static importDOM(){return{hr:e=>({conversion:()=>({node:new Fd}),priority:1})}}constructor(e){super(e)}createDOM(){const e=Ed("figure",{className:"horizontal-divider"}),t=Ed("hr");return e.addEventListener("click",(t=>{Nd(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.appendChild(t),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:Ed("hr")}}exportJSON(){return{type:"horizontal_divider",version:1}}decorate(){return null}}const Rd=["bold","italic","strikethrough","link","unlink","toggleHighlight","removeHighlight","rotateHeadingFormat","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","insertHorizontalDivider","uploadAttachments","undo","redo"];class Dd{static configureFor(e){new Dd(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.highlighter=e.highlighter,this.#q(),this.#j(),this.#G()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(cn,"bold")}dispatchItalic(){this.editor.dispatchCommand(cn,"italic")}dispatchStrikethrough(){this.editor.dispatchCommand(cn,"strikethrough")}dispatchToggleHighlight(e){this.highlighter.toggle(e)}dispatchRemoveHighlight(){this.highlighter.remove()}dispatchLink(e){this.editor.update((()=>{const t=vi();if(si(t))if(t.isCollapsed()){const n=ju(e),r=Vr(e);n.append(r),t.insertNodes([n])}else Ju(e)}))}dispatchUnlink(){this.#V(null)}dispatchInsertUnorderedList(){const e=vi();if(!e)return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"bullet"===Qu(t)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(gc,void 0)}dispatchInsertOrderedList(){const e=vi();if(!e)return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"number"===Qu(t)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(pc,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedNodes((e=>Hc(e)),(()=>Uc()))}dispatchInsertCodeBlock(){this.editor.update((()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(cn,"code"):this.contents.toggleNodeWrappingAllSelectedLines((e=>lu(e)),(()=>new ou("plain")))}))}dispatchInsertHorizontalDivider(){this.editor.update((()=>{this.contents.insertAtCursorEnsuringLineBelow(new Fd)})),this.editor.focus()}dispatchRotateHeadingFormat(){this.editor.update((()=>{const e=vi();if(!si(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow();let n="h2";if(Vc(t)){const e=t.getTag();n="h2"===e?"h3":"h3"===e?"h4":"h4"===e?null:"h2"}n?this.contents.insertNodeWrappingEachSelectedLine((()=>Gc(n))):this.contents.removeFormattingFromSelectedLines()}))}dispatchUploadAttachments(){const e=Ed("input",{type:"file",multiple:!0,style:"display: none;",onchange:({target:e})=>{const t=Array.from(e.files);if(t.length)for(const e of t)this.contents.uploadFile(e)}});this.editorElement.appendChild(e),e.click(),setTimeout((()=>e.remove()),1e3)}dispatchUndo(){this.editor.dispatchCommand(un,void 0)}dispatchRedo(){this.editor.dispatchCommand(dn,void 0)}#q(){for(const t of Rd){const n=`dispatch${e=t,e.charAt(0).toUpperCase()+e.slice(1)}`;this.#J(t,0,this[n].bind(this))}var e;this.#J(sn,1,this.dispatchPaste.bind(this))}#J(e,t,n){this.editor.registerCommand(e,n,t)}#j(){this.editor.registerCommand(wn,this.#Z.bind(this),2)}#G(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.editor.getRootElement().addEventListener("dragover",this.#Y.bind(this)),this.editor.getRootElement().addEventListener("drop",this.#X.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#Q.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#ee.bind(this)))}#Q(e){this.dragCounter++,1===this.dragCounter&&this.editor.getRootElement().classList.add("lexxy-editor--drag-over")}#ee(e){this.dragCounter--,0===this.dragCounter&&this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")}#Y(e){e.preventDefault()}#X(e){e.preventDefault(),this.dragCounter=0,this.editor.getRootElement().classList.remove("lexxy-editor--drag-over");const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);if(n.length){for(const e of n)this.contents.uploadFile(e);this.editor.focus()}}#Z(e){return!!this.selection.isInsideList&&(e.preventDefault(),e.shiftKey?this.editor.dispatchCommand(Tn,void 0):this.editor.dispatchCommand(En,void 0))}#V(e){this.editor.update((()=>{Ju(null===e?null:e)}))}}function Md(){return new Promise(requestAnimationFrame)}class zd{constructor(e){this.editorElement=e,this.editorContentElement=e.editorContentElement,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#te(),this.#ne(),this.#re(),this.#ie()}clear(){this.current=null}set current(e){ai(e)?this.editor.getEditorState().read((()=>{this._current=vi(),this.#se()})):this.editor.update((()=>{this.#se(),this._current=null}))}get current(){return this._current}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read((()=>{const t=this.#oe();if(!t)return;const n=this.#ae(t);n&&(e=this.#le(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{eo().selectEnd()}))}selectedNodeWithOffset(){const e=vi();if(!e)return{node:null,offset:0};if(si(e))return{node:e.anchor.getNode(),offset:e.anchor.offset};if(ai(e)){const[t]=e.getNodes();return{node:t,offset:0}}return{node:null,offset:0}}preservingSelection(e){let t=null;this.editor.getEditorState().read((()=>{const e=vi();e&&si(e)&&(t={anchor:{key:e.anchor.key,offset:e.anchor.offset},focus:{key:e.focus.key,offset:e.focus.offset}})})),e(),t&&this.editor.update((()=>{const e=vi();e&&si(e)&&(e.anchor.set(t.anchor.key,t.anchor.offset,"text"),e.focus.set(t.focus.key,t.focus.offset,"text"))}))}get hasSelectedWordsInSingleLine(){const e=vi();if(!si(e))return!1;if(e.isCollapsed())return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.getTopLevelElement()!==n.getTopLevelElement())return!1;if(!t.getTopLevelElement())return!1;const r=e.getNodes();for(const e of r)if(Pr(e))return!1;return!0}get isInsideList(){const e=vi();if(!si(e))return!1;return null!==Xu(e.anchor.getNode())}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#ce();return e?Jr(e)?this.#ue(e,t):ss(e)?this.#de(e,t):this.#he(e):null}get topLevelNodeAfterCursor(){const{anchorNode:e,offset:t}=this.#ce();return e?Jr(e)?this.#ge(e):ss(e)?this.#de(e,t):this.#he(e):null}get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#ce();return e?Jr(e)?this.#pe(e,t):ss(e)?this.#fe(e,t):this.#me(e):null}get topLevelNodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#ce();return e?Jr(e)?this.#ye(e):ss(e)?this.#fe(e,t):this.#me(e):null}get#_e(){return this.editorElement.contents}get#be(){if(this._currentlySelectedKeys)return this._currentlySelectedKeys;this._currentlySelectedKeys=new Set;const e=vi();if(e&&ai(e))for(const t of e.getNodes())this._currentlySelectedKeys.add(t.getKey());return this._currentlySelectedKeys}#ne(){this.editor.registerCommand(fn,this.#xe.bind(this),1),this.editor.registerCommand(gn,this.#ke.bind(this),1),this.editor.registerCommand(yn,this.#ve.bind(this),1),this.editor.registerCommand(_n,this.#Se.bind(this),1),this.editor.registerCommand(Sn,this.#we.bind(this),1),this.editor.registerCommand(kn,this.#Ce.bind(this),1),this.editor.registerCommand(Yt,(()=>{this.current=vi()}),1)}#te(){this.editor.getRootElement().addEventListener("lexxy:internal:select-node",(async e=>{await Md();const{key:t}=e.detail;this.editor.update((()=>{const e=Vs(t);if(e){const t=xi();t.add(e.getKey()),no(t)}this.editor.focus()}))})),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",(e=>{this.#Ee()}))}#re(){this.editor.getRootElement().addEventListener("keydown",(e=>{(function(e){return!(e.ctrlKey||e.metaKey||e.altKey||e.key.length>1&&"Enter"!==e.key&&"Space"!==e.key||1!==e.key.length)})(e)&&this.editor.update((()=>{const t=vi();if(si(t)&&t.isCollapsed()){const n=t.anchor.getNode(),r=t.anchor.offset,i=this.#Te(n,r),s=this.#Ne(n,r);if(i instanceof as&&!i.isInline())return e.preventDefault(),void this.#_e.createParagraphAfterNode(i,e.key);if(s instanceof as&&!s.isInline())return e.preventDefault(),void this.#_e.createParagraphBeforeNode(s,e.key)}}))}),!0)}#Te(e,t){return Jr(e)&&0===t?e.getPreviousSibling():ss(e)&&t>0?e.getChildAtIndex(t-1):null}#Ne(e,t){return Jr(e)&&t===e.getTextContentSize()?e.getNextSibling():ss(e)?e.getChildAtIndex(t):null}#ie(){this.editorContentElement.addEventListener("keydown",(e=>{if("ArrowUp"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.previousElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.previousElementSibling;n||e.preventDefault()}}if("ArrowDown"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.nextElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.nextElementSibling;n||e.preventDefault()}}}),!0)}#se(){this.#Ae(),this.#Le(),this.previouslySelectedKeys=this.#be,this._currentlySelectedKeys=null}#Ae(){for(const e of this.previouslySelectedKeys)if(!this.#be.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#Le(){for(const e of this.#be)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#xe(){this.current?await this.#Pe((e=>e.selectPrevious())):this.#Oe(this.nodeBeforeCursor)}async#ke(){this.current?await this.#Pe((e=>e.selectNext(0,0))):this.#Oe(this.nodeAfterCursor)}async#ve(){this.current?await this.#Pe((e=>e.selectPrevious())):this.#Oe(this.topLevelNodeBeforeCursor)}async#Se(){this.current?await this.#Pe((e=>e.selectNext(0,0))):this.#Oe(this.topLevelNodeAfterCursor)}async#Pe(e){await Md(),this.current&&this.editor.update((()=>{this.clear(),e(this.current.getNodes()[0]),this.editor.focus()}))}async#Ee(){this.editor.update((()=>{const e=this.#Ie();e&&this.#Fe(e)}))}#Ie(){const e=vi();return e?ai(e)?this.#Re(e):si(e)?this.#De(e):null:null}#Re(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#De(e){return e.anchor.getNode().getTopLevelElement()}#Fe(e){const t=e.getNextSibling();t?t.selectStart():this.#Me()}#Me(){const e=eo(),t=_s();e.append(t),t.selectStart()}#Oe(e){e&&e instanceof as&&this.editor.update((()=>{const t=xi();t.add(e.getKey()),no(t)}))}#we(){const e=this.nodeAfterCursor;return e instanceof as?(this.#Oe(e),!0):(this.#_e.deleteSelectedNodes(),!1)}#Ce(){const e=this.nodeBeforeCursor;return e instanceof as?(this.#Oe(e),!0):(this.#_e.deleteSelectedNodes(),!1)}#oe(){const e=vi();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#ae(e){let t=e.getBoundingClientRect();if(this.#ze(t)){const n=this.#Be(e);t=n.getBoundingClientRect(),this.#$e(n),n.remove()}return t}#ze(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#Be(e){const t=this.#Ue();return e.insertNode(t),t}#Ue(){const e=document.createElement("span");return e.textContent="",e.style.display="inline-block",e.style.width="1px",e.style.height="1em",e.style.lineHeight="normal",e.setAttribute("nonce",cl()),e}#$e(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#le(e,t){const n=this.editor.getRootElement().getBoundingClientRect(),r=e.left-n.left;let i=e.top-n.top;const s=this.#He(t);return isNaN(s)||(i+=s),{x:r,y:i,fontSize:s}}#He(e){const t=window.getSelection().anchorNode,n=this.#We(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#We(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#ce(){const e=vi();if(!si(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#ue(e,t){return t===e.getTextContentSize()?this.#ge(e):null}#ge(e){if(e.getNextSibling()instanceof as)return e.getNextSibling();const t=e.getParent();return t?t.getNextSibling():null}#de(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#he(e)}#pe(e,t){return 0===t?this.#ye(e):null}#ye(e){if(e.getPreviousSibling()instanceof as)return e.getPreviousSibling();return e.getParent().getPreviousSibling()}#fe(e,t){return t>0?e.getChildAtIndex(t-1):this.#me(e)}#he(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#me(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}}class Bd extends as{static getType(){return"custom_action_text_attachment"}static clone(e){return new Bd({...e},e.__key)}static importJSON(e){return new Bd({...e})}static importDOM(){return{"action-text-attachment":e=>{const t=e.getAttribute("content");return e.getAttribute("content")?{conversion:()=>{const n=[],r=e.previousSibling;return r&&r.nodeType===Node.TEXT_NODE&&/\s$/.test(r.textContent)&&n.push(Vr(" ")),n.push(new Bd({sgid:e.getAttribute("sgid"),innerHtml:JSON.parse(t),contentType:e.getAttribute("content-type")})),n.push(Vr(" ")),{node:n}},priority:2}:null}}}constructor({sgid:e,contentType:t,innerHtml:n},r){super(r),this.sgid=e,this.contentType=t||"application/vnd.actiontext.unknown",this.innerHtml=n}createDOM(){const e=Ed("action-text-attachment",{"content-type":this.contentType,"data-lexxy-decorator":!0});return e.addEventListener("click",(t=>{Nd(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.insertAdjacentHTML("beforeend",this.innerHtml),e}updateDOM(){return!0}isInline(){return!0}exportDOM(){return{element:Ed("action-text-attachment",{sgid:this.sgid,content:JSON.stringify(this.innerHtml),"content-type":this.contentType})}}exportJSON(){return{type:"custom_action_text_attachment",version:1,sgid:this.sgid,contentType:this.contentType,innerHtml:this.innerHtml}}decorate(){return null}}class $d{constructor(e){this.editorElement=e,this.editor=e.editor}monitor(){this.editor.registerCommand(bn,(e=>this.#Ke(e)),3)}#Ke(e){const t=vi();if(!si(t))return!1;const n=t.anchor.getNode();return!!this.#qe(n)&&(this.#je(e,n)||this.#Ge(e,n))}#je(e,t){return!(!this.#Ve(t)&&!this.#Je(t))&&(e.preventDefault(),this.#Ze(t),!0)}#Ge(e,t){return!!this.#Ye(t)&&(e.preventDefault(),this.#Xe(t),!0)}#qe(e){let t=e;for(;t;){if(Hc(t))return!0;t=t.getParent()}return!1}#Ve(e){const t=this.#Qe(e);return!!t&&this.#et(t)}#Je(e){const t=this.#tt(e);if(!t)return!1;if(!this.#et(t))return!1;const n=t.getParent();return n&&ic(n)}#et(e){if(""!==e.getTextContent().trim())return!1;const t=e.getChildren();return 0===t.length||t.every((e=>!!Pr(e)||this.#et(e)))}#Qe(e){let t=e;for(;t;){if(ic(t))return t;t=t.getParent()}return null}#Ze(e){const t=this.#Qe(e);if(!t)return;const n=t.getParent();if(!n||!dc(n))return;const r=n.getParent();if(r&&Hc(r)){const e=this.#nt(t).filter((e=>!this.#et(e)));if(e.length>0)return void this.#rt(r,n,t,e)}const i=_s();n.insertAfter(i),t.remove(),i.selectStart()}#Ye(e){const t=this.#tt(e);if(!t)return!1;if(!this.#et(t))return!1;const n=t.getParent();return n&&Hc(n)}#tt(e){let t=e;for(;t;){if(bs(t))return t;t=t.getParent()}return null}#Xe(e){const t=this.#tt(e);if(!t)return;const n=t.getParent();if(!n||!Hc(n))return;const r=this.#it(t).filter((e=>!this.#et(e)));if(r.length>0)this.#st(n,t,r);else{const e=_s();n.insertAfter(e),t.remove(),e.selectStart()}}#it(e){const t=[];let n=e.getNextSibling();for(;n;)t.push(n),n=n.getNextSibling();return t}#nt(e){const t=[];let n=e.getNextSibling();for(;n;)ic(n)&&t.push(n),n=n.getNextSibling();return t}#rt(e,t,n,r){const i=this.#it(t).filter((e=>!this.#et(e))),s=_s();e.insertAfter(s);const o=uc(t.getListType()),a=Uc();s.insertAfter(a),a.append(o),r.forEach((e=>{o.append(e)})),i.forEach((e=>{a.append(e)})),n.remove(),this.#ot(t),this.#at(a),0===t.getChildrenSize()?(t.remove(),0===e.getChildrenSize()&&e.remove()):this.#at(e),s.selectStart()}#ot(e){const t=e.getChildren();for(let e=t.length-1;e>=0;e--){const n=t[e];if(!ic(n)||!this.#et(n))break;n.remove()}}#at(e){const t=e.getChildren();for(let e=t.length-1;e>=0;e--){const n=t[e];if(!this.#et(n))break;n.remove()}}#st(e,t,n){const r=_s();e.insertAfter(r);const i=Uc();r.insertAfter(i),n.forEach((e=>{i.append(e)})),t.remove(),this.#at(e),this.#at(i),r.selectStart()}}class Ud{constructor(e){this.editorElement=e,this.editor=e.editor,new $d(e).monitor()}insertHtml(e){this.editor.update((()=>{const t=vi();if(!si(t))return;const n=yc(this.editor,Td(e));t.insertNodes(n)}))}insertAtCursor(e){this.editor.update((()=>{const t=vi(),n=t?.getNodes();if(si(t))Ai([e]);else if(ai(t)&&n&&n.length>0){n[n.length-1].insertAfter(e)}else{eo().append(e)}}))}insertAtCursorEnsuringLineBelow(e){this.insertAtCursor(e),this.#lt(e)}insertNodeWrappingEachSelectedLine(e){this.editor.update((()=>{const t=vi();if(!si(t))return;t.extract().forEach((t=>{if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e();r.append(...n.getChildren()),n.replace(r)}))}))}toggleNodeWrappingAllSelectedLines(e,t){this.editor.update((()=>{const n=vi();if(!si(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.removeFormattingFromSelectedLines():this.#ct(t)}))}toggleNodeWrappingAllSelectedNodes(e,t){this.editor.update((()=>{const n=vi();if(!si(n))return;const r=n.anchor.getNode().getTopLevelElement();r&&e(r)?this.#ut(r):this.#dt(t)}))}removeFormattingFromSelectedLines(){this.editor.update((()=>{const e=vi();if(!si(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow(),n=_s();n.append(...t.getChildren()),t.replace(n)}))}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=vi();e=si(t)&&!t.isCollapsed()})),e}unwrapSelectedListItems(){this.editor.update((()=>{const e=vi();if(!si(e))return;const{listItems:t,parentLists:n}=this.#ht(e);if(t.size>0){const e=this.#gt(t);this.#pt(n),this.#ft(e)}}))}createLink(e){let t=null;return this.editor.update((()=>{const n=Vr(e),r=Wu(e);r.append(n);const i=vi();si(i)&&(i.insertNodes([r]),t=r.getKey())})),t}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{Ju(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=vi();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Jr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o),l=a.lastIndexOf(e);-1!==l&&(t=a.slice(l+e.length))})),t}containsTextBackUntil(e){let t=!1;return this.editor.getEditorState().read((()=>{const n=vi();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Jr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o);t=a.includes(e)})),t}replaceTextBackUntil(e,t){t=Array.isArray(t)?t:[t],this.editor.update((()=>{const{anchorNode:n,offset:r}=this.#mt();if(!n)return;const i=this.#yt(n,r,e);-1!==i&&this.#_t(n,r,i,t)}))}createParagraphAfterNode(e,t){const n=_s();e.insertAfter(n),n.selectStart(),t&&(n.append(Vr(t)),n.select(1,1))}createParagraphBeforeNode(e,t){const n=_s();e.insertBefore(n),n.selectStart(),t&&(n.append(Vr(t)),n.select(1,1))}uploadFile(e){if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");if(!this.#bt(e))return;const t=this.editorElement.directUploadUrl,n=this.editorElement.blobUrlTemplate;this.editor.update((()=>{const r=new Id({file:e,uploadUrl:t,blobUrlTemplate:n,editor:this.editor});this.insertAtCursor(r)}),{tag:Sr})}async deleteSelectedNodes(){let e=null;this.editor.update((()=>{if(ai(this.#xt.current)){const t=this.#xt.current.getNodes();if(0===t.length)return;e=this.#kt(t),this.#vt(t)}})),await Md(),this.editor.update((()=>{this.#St(e),this.#xt.clear(),this.editor.focus()}))}replaceNodeWithHTML(e,t,n={}){this.editor.update((()=>{const r=Vs(e);if(!r)return;const i=vi();let s=!1;if(si(i)){const e=i.getNodes();s=e.includes(r)||e.some((e=>e.getParent()===r)),s&&no(null)}const o=n.attachment?this.#wt(t,n.attachment):this.#Ct(t);r.replace(o),s&&o.selectEnd()}))}insertHTMLBelowNode(e,t,n={}){this.editor.update((()=>{const r=Vs(e);if(!r)return;const i=r.getTopLevelElement()||r,s=n.attachment?this.#wt(t,n.attachment):this.#Ct(t);i.insertAfter(s)}))}get#xt(){return this.editorElement.selection}#lt(e){this.editor.update((()=>{if(!e.getNextSibling()){const t=_s();e.insertAfter(t),t.selectStart()}}))}#ut(e){e.getChildren().forEach((t=>{e.insertBefore(t)})),e.remove()}#dt(e){this.editor.update((()=>{const t=vi();if(!si(t))return;const n=t.extract();if(0===n.length)return;const r=new Set;n.forEach((e=>{const t=e.getTopLevelElementOrThrow();r.add(t)}));const i=this.#Et(Array.from(r));if(0===i.length)return this.#Tt(),void this.insertAtCursor(e());const s=e();i[0].insertBefore(s),i.forEach((e=>{s.append(e)}))}))}#Et(e){let t=e.length-1;for(;t>=0;){const n=e[t];if(!bs(n)||!this.#Nt(n))break;t--}return e.slice(0,t+1)}#Nt(e){if(""!==e.getTextContent().trim())return!1;const t=e.getChildren();return 0===t.length||t.every((e=>Pr(e)))}#Tt(){const e=eo();if(1===e.getChildrenSize()){const t=e.getFirstChild();t&&bs(t)&&this.#Nt(t)&&t.remove()}}#ct(e){this.editor.update((()=>{const t=vi();si(t)&&(t.isCollapsed()?this.#At(t,e):this.#Lt(t,e))}))}#At(e,t){const n=e.anchor.getNode().getTopLevelElementOrThrow();if(n.getTextContent()){const e=t();e.append(...n.getChildren()),n.replace(e)}else Ai([t()])}#Lt(e,t){const n=this.#Pt(e);if(0===n.length)return;const{lineSet:r,nodesToDelete:i}=this.#Ot(n);if(0===r.size)return;const s=this.#It(t,r);this.#Ft(e,s),this.#Rt(i)}#Pt(e){const t=e.extract().map((e=>this.#Dt(e))).filter(Boolean);return no(null),t}#Dt(e){return bs(e)?e:Jr(e)&&e.getParent()&&bs(e.getParent())?e.getParent():null}#Ot(e){const t=new Set,n=new Set;return e.forEach((e=>{const r=e.getTextContent();r&&r.split("\n").forEach((e=>{e.trim()&&t.add(e)})),n.add(e)})),{lineSet:t,nodesToDelete:n}}#It(e,t){const n=e(),r=Array.from(t);return r.forEach(((e,t)=>{n.append(Vr(e)),t<r.length-1&&n.append(Lr())})),n}#Ft(e,t){const n=e.anchor.getNode().getParent();n&&n.replace(t)}#Rt(e){e.forEach((e=>e.remove()))}#vt(e){e.forEach((e=>{const t=e.getParent();if(!ss(t))return;const n=t.getChildren().indexOf(e);n>=0&&t.splice(n,1,[])}))}#kt(e){const t=e[0],n=e[e.length-1];return t?.getPreviousSibling()||n?.getNextSibling()}#St(e){const t=eo();if(0===t.getChildrenSize()){const e=_s();t.append(e),e.selectStart()}else e&&(Jr(e)||bs(e)?e.selectEnd():e.selectNext(0,0))}#ht(e){const t=e.getNodes(),n=new Set,r=new Set;for(const e of t){const t=Xu(e);if(t){n.add(t);const e=t.getParent();e&&dc(e)&&r.add(e)}}return{listItems:n,parentLists:r}}#gt(e){const t=[];for(const n of e){const e=this.#Mt(n);e&&t.push(e)}return t}#Mt(e){const t=e.getParent();if(!t||!dc(t))return null;const n=_s(),r=this.#zt(e,n);return e.insertAfter(n),this.#Bt(n,r),e.remove(),n}#zt(e,t){const n=[];return e.getChildren().forEach((e=>{dc(e)?n.push(e):t.append(e)})),n}#Bt(e,t){t.forEach((t=>{e.insertAfter(t)}))}#pt(e){for(const t of e)dc(t)&&0===t.getChildrenSize()&&t.remove()}#ft(e){if(0===e.length)return;const t=e[0],n=e[e.length-1];1===e.length?t.selectEnd():this.#$t(t,n)}#$t(e,t){e.selectStart();const n=vi();n&&si(n)&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#mt(){const e=vi();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Jr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#yt(e,t,n){return e.getTextContent().slice(0,t).lastIndexOf(n)}#_t(e,t,n,r){const i=e.getTextContent(),s=i.slice(0,n),o=i.slice(t),a=Vr(s),l=Vr(o||" ");e.replace(a);this.#Ut(a,r).insertAfter(l),this.#Ht(l.getParentOrThrow());const c=o?0:1;l.select(c,c)}#Ut(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#Ht(e){if(bs(e)&&!this.editorElement.isSingleLineMode){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Jr(n)&&""===n.getTextContent()&&r&&!Jr(r)&&e.append(Lr())}}#wt(e,t={}){return new Bd({sgid:("object"==typeof t?t:{}).sgid||null,contentType:"text/html",innerHtml:e})}#Ct(e){return yc(this.editor,Td(e))[0]||_s()}#bt(e){return Ad(this.editorElement,"lexxy:file-accept",{file:e},!0)}}function Hd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wd={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Kd(e){Wd=e}var qd={exec:()=>null};function jd(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(Gd.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Gd={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Vd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jd=/(?:[*+-]|\d{1,9}[.)])/,Zd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Yd=jd(Zd).replace(/bull/g,Jd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Xd=jd(Zd).replace(/bull/g,Jd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,eh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,th=jd(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",eh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),nh=jd(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jd).getRegex(),rh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ih=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sh=jd("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",ih).replace("tag",rh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oh=jd(Qd).replace("hr",Vd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rh).getRegex(),ah={blockquote:jd(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",oh).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:th,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Vd,html:sh,lheading:Yd,list:nh,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:oh,table:qd,text:/^[^\n]+/},lh=jd("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rh).getRegex(),ch={...ah,lheading:Xd,table:lh,paragraph:jd(Qd).replace("hr",Vd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rh).getRegex()},uh={...ah,html:jd("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ih).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:jd(Qd).replace("hr",Vd).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Yd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dh=/^( {2,}|\\)\n(?!\s*$)/,hh=/[\p{P}\p{S}]/u,gh=/[\s\p{P}\p{S}]/u,ph=/[^\s\p{P}\p{S}]/u,fh=jd(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gh).getRegex(),mh=/(?!~)[\p{P}\p{S}]/u,yh=jd(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_h=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,bh=jd(_h,"u").replace(/punct/g,hh).getRegex(),xh=jd(_h,"u").replace(/punct/g,mh).getRegex(),kh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vh=jd(kh,"gu").replace(/notPunctSpace/g,ph).replace(/punctSpace/g,gh).replace(/punct/g,hh).getRegex(),Sh=jd(kh,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,mh).getRegex(),wh=jd("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ph).replace(/punctSpace/g,gh).replace(/punct/g,hh).getRegex(),Ch=jd(/\\(punct)/,"gu").replace(/punct/g,hh).getRegex(),Eh=jd(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Th=jd(ih).replace("(?:--\x3e|$)","--\x3e").getRegex(),Nh=jd("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Th).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ah=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Lh=jd(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ah).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ph=jd(/^!?\[(label)\]\[(ref)\]/).replace("label",Ah).replace("ref",eh).getRegex(),Oh=jd(/^!?\[(ref)\](?:\[\])?/).replace("ref",eh).getRegex(),Ih=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fh={_backpedal:qd,anyPunctuation:Ch,autolink:Eh,blockSkip:yh,br:dh,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:qd,emStrongLDelim:bh,emStrongRDelimAst:vh,emStrongRDelimUnd:wh,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Lh,nolink:Oh,punctuation:fh,reflink:Ph,reflinkSearch:jd("reflink|nolink(?!\\()","g").replace("reflink",Ph).replace("nolink",Oh).getRegex(),tag:Nh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:qd},Rh={...Fh,link:jd(/^!?\[(label)\]\((.*?)\)/).replace("label",Ah).getRegex(),reflink:jd(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ah).getRegex()},Dh={...Fh,emStrongRDelimAst:Sh,emStrongLDelim:xh,url:jd(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ih).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:jd(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ih).getRegex()},Mh={...Dh,br:jd(dh).replace("{2,}","*").getRegex(),text:jd(Dh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},zh={normal:ah,gfm:ch,pedantic:uh},Bh={normal:Fh,gfm:Dh,breaks:Mh,pedantic:Rh},$h={"&":"&","<":"<",">":">",'"':""","'":"'"},Uh=e=>$h[e];function Hh(e,t){if(t){if(Gd.escapeTest.test(e))return e.replace(Gd.escapeReplace,Uh)}else if(Gd.escapeTestNoEncode.test(e))return e.replace(Gd.escapeReplaceNoEncode,Uh);return e}function Wh(e){try{e=encodeURI(e).replace(Gd.percentDecode,"%")}catch{return null}return e}function Kh(e,t){let n=e.replace(Gd.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split(Gd.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Gd.slashPipe,"|");return r}function qh(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function jh(e,t,n,r,i){let s=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var Gh=class{options;rules;lexer;constructor(e){this.options=e||Wd}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:qh(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=qh(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:qh(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=qh(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===e.length)break;let u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.blockquote(s);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==u?.type);else{let t=u,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=s.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r="",a="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,a=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),s=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let h,g=e.split("\n",1)[0];if(c=g,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),i.test(c)||s.test(c)||o.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())a+="\n"+h.slice(d);else{if(u||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(l)||s.test(l)||n.test(l))break;a+="\n"+c}!u&&!c.trim()&&(u=!0),r+=g+"\n",e=e.substring(g.length+1),l=h.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let h,g=null;this.options.gfm&&(g=this.rules.other.listIsTask.exec(a),g&&(h="[ ] "!==g[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!g,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}let a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Kh(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Kh(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=qh(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),jh(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return jh(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=0,l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=l.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(i=[...n].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&s%3&&!((s+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let t=[...r[0]][0].length,l=e.slice(0,s+r.index+t+i);if(Math.min(s,i)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Vh=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Wd,this.options.tokenizer=this.options.tokenizer||new Gh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Gd,block:zh.normal,inline:Bh.normal};this.options.pedantic?(t.block=zh.pedantic,t.inline=Bh.pedantic):this.options.gfm&&(t.block=zh.gfm,this.options.breaks?t.inline=Bh.breaks:t.inline=Bh.gfm),this.tokenizer.rules=t}static get rules(){return{block:zh,inline:Bh}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Gd.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Gd.tabCharGlobal," ").replace(Gd.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,s="";for(;e;){let r;if(i||(s=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,s)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),i=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},Jh=class{options;parser;constructor(e){this.options=e||Wd}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(Gd.notSpaceStart)?.[0],i=e.replace(Gd.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Hh(r)+'">'+(n?i:Hh(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Hh(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+Hh(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Hh(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Wh(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+Hh(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Wh(e);if(null===i)return Hh(n);let s=`<img src="${e=i}" alt="${n}"`;return t&&(s+=` title="${Hh(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Hh(e.text)}},Zh=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Yh=class e{options;renderer;textRenderer;constructor(e){this.options=e||Wd,this.options.renderer=this.options.renderer||new Jh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zh}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){n+=t||"";continue}}let s=i;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":{let i=s,o=this.renderer.text(i);for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+this.renderer.text(i);n+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}let s=i;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Xh=class{options;block;constructor(e){this.options=e||Wd}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Vh.lex:Vh.lexInline}provideParser(){return this.block?Yh.parse:Yh.parseInline}},Qh=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Yh;Renderer=Jh;TextRenderer=Zh;Lexer=Vh;Tokenizer=Gh;Hooks=Xh;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Jh(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Gh(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Xh;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];Xh.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Xh.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return s.call(t,n)})();let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await s.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Vh.lex(e,t??this.defaults)}parser(e,t){return Yh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?Vh.lex:Vh.lexInline)(n,i),s=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?Yh.parse:Yh.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?Vh.lex:Vh.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?Yh.parse:Yh.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Hh(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function eg(e,t){return Qh.parse(e,t)}function tg(e){try{return new URL(e),!0}catch{return!1}}function ng(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}eg.options=eg.setOptions=function(e){return Qh.setOptions(e),eg.defaults=Qh.defaults,Kd(eg.defaults),eg},eg.getDefaults=Hd,eg.defaults=Wd,eg.use=function(...e){return Qh.use(...e),eg.defaults=Qh.defaults,Kd(eg.defaults),eg},eg.walkTokens=function(e,t){return Qh.walkTokens(e,t)},eg.parseInline=Qh.parseInline,eg.Parser=Yh,eg.parser=Yh.parse,eg.Renderer=Jh,eg.TextRenderer=Zh,eg.Lexer=Vh,eg.lexer=Vh.lex,eg.Tokenizer=Gh,eg.Hooks=Xh,eg.parse=eg,eg.options,eg.setOptions,eg.use,eg.walkTokens,eg.parseInline,Yh.parse,Vh.lex;class rg{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){const t=e.clipboardData;return!!t&&(this.#Wt(t)&&!this.#Kt()?(this.#qt(t),e.preventDefault(),!0):void this.#jt(t))}#Wt(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#Kt(){let e=!1;return this.editor.getEditorState().read((()=>{const t=vi();if(!si(t))return;let n=t.anchor.getNode();for(;n;){if(lu(n))return void(e=!0);n=n.getParent()}})),e}#qt(e){e.items[0].getAsString((e=>{if(tg(e)&&this.contents.hasSelectedText())this.contents.createLinkWithSelectedText(e);else if(tg(e)){const t=this.contents.createLink(e);this.#Gt(t,{url:e})}else this.#Vt(e)}))}#Gt(e,t){const n={replaceLinkWith:(t,n)=>this.contents.replaceNodeWithHTML(e,t,n),insertBelowLink:(t,n)=>this.contents.insertHTMLBelowNode(e,t,n)};Ad(this.editorElement,"lexxy:insert-link",{...t,...n})}#Vt(e){const t=eg(e);this.contents.insertHtml(t)}#jt(e){if(!this.editorElement.supportsAttachments)return;e.getData("text/html")||this.#Jt((()=>{for(const t of e.items){const e=t.getAsFile();e&&this.contents.uploadFile(e)}}))}async#Jt(e){const t=window.scrollY,n=window.scrollX;e(),await Md(),window.scrollTo(n,t),this.editor.focus()}}class ig{constructor(e){this.editor=e.editor,this.#Zt()}toggle(e){this.editor.update((()=>{this.#Yt(e)}))}remove(){this.toggle({color:null,"background-color":null})}#Zt(){return this.editor.registerNodeTransform(Br,(e=>{this.#Xt(e)}))}#Yt(e){const t=vi();if(!si(t))return;const n={};for(const r in e){const i=al(t,r);n[r]=this.#Qt(i,e[r])}el(t,n)}#Qt(e,t){return e===t?null:t}#Xt(e){nd(e.getStyle())!==e.hasFormat("highlight")&&e.toggleFormat("highlight")}}class sg extends Br{$config(){return this.config("highlight",{extends:Br})}static importDOM(){return{mark:()=>({conversion:ed("mark",og),priority:1})}}}function og(e,t){const n=t.style?.color,r=t.style?.backgroundColor;let i="";if(n&&""!==n&&(i+=`color: ${n};`),r&&""!==r&&(i+=`background-color: ${r};`),i.length)return e.hasFormat("highlight")||e.toggleFormat("highlight"),e.setStyle(e.getStyle()+i)}const ag="language";class lg extends Br{$config(){return this.config("trix-text",{extends:Br})}static importDOM(){return{em:e=>cg(e,{conversion:ed("i",og),priority:1}),span:e=>cg(e,{conversion:ed("mark",og),priority:1}),strong:e=>cg(e,{conversion:ed("b",og),priority:1}),del:()=>({conversion:ed("s",ug),priority:1}),pre:e=>function(e,t){return e.hasAttribute(ag)?t:null}(e,{conversion:td(ou,"pre",dg),priority:1})}}}function cg(e,t){return""!==e.style.color||""!==e.style.backgroundColor?t:null}function ug(e,t){return e.hasFormat("strikethrough")||e.toggleFormat("strikethrough"),og(e,t)}function dg(e,t){const n=Cu(t.getAttribute(ag));e.node.setLanguage(n)}class hg extends HTMLElement{static formAssociated=!0;static debug=!0;static commands=["bold","italic","strikethrough"];static observedAttributes=["connected","required"];#en="";#tn=document.createElement("textarea");constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=Ld("lexxy-editor"),this.editor=this.#nn(),this.contents=new Ud(this),this.selection=new zd(this),this.clipboard=new rg(this),this.highlighter=new ig(this),Dd.configureFor(this),this.#rn(),requestAnimationFrame((()=>Ad(this,"lexxy:initialize"))),this.toggleAttribute("connected",!0),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,this.#in()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#n())),"required"===e&&this.isConnected&&(this.#tn.required=this.hasAttribute("required"),this.#sn())}formResetCallback(){this.value=this.#en,this.editor.dispatchCommand(Mn,void 0)}get form(){return this.internals.form}get name(){return this.getAttribute("name")}get toolbarElement(){return this.#on?(this.toolbar=this.toolbar||this.#an(),this.toolbar):null}get directUploadUrl(){return this.dataset.directUploadUrl}get blobUrlTemplate(){return this.dataset.blobUrlTemplate}get isSingleLineMode(){return this.hasAttribute("single-line")}get supportsAttachments(){return"false"!==this.getAttribute("attachments")}get contentTabIndex(){return parseInt(this.editorContentElement?.getAttribute("tabindex")??"0")}focus(){this.editor.focus()}get value(){return this.cachedValue||this.editor?.getEditorState().read((()=>{this.cachedValue=function(e){return se.sanitize(e)}(_c(this.editor,null))})),this.cachedValue}set value(e){this.editor.update((()=>{No(Er);const t=eo();t.clear(),""!==e&&t.append(...this.#ln(e)),t.select(),this.#cn(),requestAnimationFrame((()=>this.editor?.update((()=>{}))))}))}#ln(e){e||(e="<p></p>");return yc(this.editor,Td(`<div>${e}</div>`)).map((e=>{if("paragraph"===e.getType()&&1===e.getChildrenSize()){const t=e.getFirstChild();if(t instanceof as&&!t.isInline())return t}return e}))}#rn(){this.#un(),this.#dn(),this.#hn(),this.#gn(),this.#pn(),this.#fn(),this.#mn(),this.#yn(),this.#_n()}#nn(){this.editorContentElement=this.editorContentElement||this.#bn();const e=vs({namespace:"LexicalEditor",onError(e){throw e},theme:Cd,nodes:this.#xn});return e.setRootElement(this.editorContentElement),e}get#xn(){const e=[lg,sg,$c,Wc,sc,ec,ou,fu,Uu,qu,Fd,Bd];return this.supportsAttachments&&e.push(Od,Id),e}#bn(){const e=Ed("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#kn,placeholder:this.getAttribute("placeholder")});return e.id=`${this.id}-content`,this.#vn.forEach((t=>e.setAttribute(t.name,t.value))),this.appendChild(e),this.getAttribute("tabindex")?(e.setAttribute("tabindex",this.getAttribute("tabindex")),this.removeAttribute("tabindex")):e.setAttribute("tabindex",0),e}get#kn(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#vn(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}set#Sn(e){const t=void 0!==this.#Sn&&this.#Sn!==this.value;this.internals.setFormValue(e),this._internalFormValue=e,this.#tn.value=this.#wn?"":e,t&&Ad(this,"lexxy:change")}get#Sn(){return this._internalFormValue}#yn(){const e=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=this.#en=e}#_n(){document.addEventListener("turbo:before-cache",this.#Cn)}#Cn=e=>{this.#in()};#un(){this.#En(this.editor.registerUpdateListener((({editorState:e})=>{this.cachedValue=null,this.#Sn=this.value,this.#cn(),this.#sn()})))}#En(e){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(e)}#Tn(){this.unregisterHandlers?.forEach((e=>{e()})),this.unregisterHandlers=null}#dn(){Qc(this.editor),this.historyState={current:null,redoStack:[],undoStack:[]},Sd(this.editor,this.historyState,20),mc(this.editor),this.#Nn(),xd(this.editor,yd)}#Nn(){!function(e,t){if(!e.hasNodes([ou,fu]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=Au);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(ou,(t=>{e.getEditorState().read((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Vs(n);null!==t&&Pu(t,e)}}))}),{skipInitialization:!1})),n.push(e.registerNodeTransform(ou,(n=>Iu(n,e,t))),e.registerNodeTransform(Br,(n=>Lu(n,e,t))),e.registerNodeTransform(fu,(n=>Lu(n,e,t))),e.registerCommand(wn,(t=>{const n=function(e){const t=vi();if(!si(t)||!Ru(t))return null;const n=e?Tn:En,r=e?Tn:Cn,i=t.anchor,s=t.focus;if(i.is(s))return r;const o=Du(t);if(1!==o.length)return n;const a=o[0];let l,c;0===a.length&&tu(285),t.isBackward()?(l=s,c=i):(l=i,c=s);const u=xu(a[0]),d=ku(a[0]),h=ti(u.getKey(),0,"text"),g=ti(d.getKey(),d.getTextContentSize(),"text");return l.isBefore(h)||g.isBefore(c)?n:h.isBefore(l)||c.isBefore(g)?r:n}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),1),e.registerCommand(Cn,(()=>!!Ru(vi())&&(Ai([Xr()]),!0)),1),e.registerCommand(En,(e=>Mu(En)),1),e.registerCommand(Tn,(e=>Mu(Tn)),1),e.registerCommand(yn,(e=>{const t=vi();if(!si(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Ru(t)&&(t.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&lu(r.getParentOrThrow())?(e.preventDefault(),!0):zu(yn,e))}),1),e.registerCommand(_n,(e=>{const t=vi();if(!si(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Ru(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&lu(r.getParentOrThrow())?(e.preventDefault(),!0):zu(_n,e))}),1),e.registerCommand(mn,(e=>Bu(mn,e)),1),e.registerCommand(pn,(e=>Bu(pn,e)),1)),gl(...n)}(this.editor),this.append(Ed("lexxy-code-language-picker"))}#hn(){this.editor.getRootElement().addEventListener("lexxy:internal:invalidate-node",(e=>{const{key:t,values:n}=e.detail;this.editor.update((()=>{const e=Vs(t);if(e instanceof Od){const t=e.getWritable();Object.assign(t,n)}}))}))}#gn(){this.editor.registerCommand(bn,(e=>(e.ctrlKey||e.metaKey||!!this.isSingleLineMode)&&(e.preventDefault(),!0)),2)}#pn(){this.editor.registerCommand(Un,(()=>{Ad(this,"lexxy:blur")}),2),this.editor.registerCommand($n,(()=>{Ad(this,"lexxy:focus")}),2)}#fn(){hg.debug&&this.#En(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{console.debug("HTML: ",this.value)}))})))}#mn(){this.#on&&this.toolbarElement.setEditor(this)}#an(){const e=this.getAttribute("toolbar");return e?document.getElementById(e):this.#An()}get#on(){return"false"!==this.getAttribute("toolbar")}#An(){const e=Ed("lexxy-toolbar");return e.innerHTML=rd.defaultTemplate,e.setAttribute("data-attachments",this.supportsAttachments),this.prepend(e),e}#cn(){this.classList.toggle("lexxy-editor--empty",this.#wn)}get#wn(){return["<p><br></p>","<p></p>",""].includes(this.value.trim())}#sn(){this.#tn.validity.valid?this.internals.setValidity({}):this.internals.setValidity(this.#tn.validity,this.#tn.validationMessage,this.editorContentElement)}#in(){this.#Tn(),this.editorContentElement&&(this.editorContentElement.remove(),this.editorContentElement=null),this.contents=null,this.editor=null,this.toolbar&&(this.getAttribute("toolbar")||this.toolbar.remove(),this.toolbar=null),this.selection=null,document.removeEventListener("turbo:before-cache",this.#Cn)}#n(){this.disconnectedCallback(),this.valueBeforeDisconnect=null,this.connectedCallback()}}customElements.define("lexxy-editor",hg);class gg extends HTMLElement{connectedCallback(){this.container=this.closest("details"),this.container.addEventListener("toggle",this.#Ln.bind(this)),this.container.addEventListener("keydown",this.#Pn.bind(this)),this.#s()}disconnectedCallback(){this.#On(),this.container.removeEventListener("keydown",this.#Pn.bind(this))}get toolbar(){return this.closest("lexxy-toolbar")}get editor(){return this.toolbar.editor}close(){this.container.removeAttribute("open")}#Ln(e){this.container.open?this.#In(e.target):this.#Fn()}#In(e){this.trigger=e,this.#Rn[0].focus(),this.#Dn()}#Fn(){this.trigger=null,this.#On(),this.editor.focus()}#Dn(){this.clickOutsideHandler||(this.clickOutsideHandler=this.#Mn.bind(this),document.addEventListener("click",this.clickOutsideHandler,!0))}#On(){this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler,!0),this.clickOutsideHandler=null)}#Mn({target:e}){this.container.open&&!this.container.contains(e)&&this.close()}#Pn(e){"Escape"===e.key&&(e.stopPropagation(),this.close())}async#s(){await Md(),this.#Rn.forEach((e=>{e.setAttribute("tabindex",0)}))}get#Rn(){return Array.from(this.querySelectorAll("button, input"))}}customElements.define("lexxy-link-dropdown",class extends gg{connectedCallback(){super.connectedCallback(),this.input=this.querySelector("input"),this.#zn()}#zn(){this.container.addEventListener("toggle",this.#Ln.bind(this)),this.addEventListener("submit",this.#Bn.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#$n.bind(this))}#Ln({newState:e}){this.input.value=this.#Un,this.input.required="open"===e}#Bn(e){const t=e.submitter?.value;this.editor.dispatchCommand(t,this.input.value),this.close()}#$n(){this.editor.dispatchCommand("unlink"),this.close()}get#Un(){let e="";return this.editor.getEditorState().read((()=>{const t=vi();if(!si(t))return;let n=t.getNodes()[0];for(;n&&n.getParent();){if(Ku(n)){e=n.getURL();break}n=n.getParent()}})),e}});const pg="button.lexxy-highlight-button",fg="[data-command='removeHighlight']",mg=Symbol("no_style");customElements.define("lexxy-highlight-dropdown",class extends gg{connectedCallback(){super.connectedCallback(),this.#Hn(),this.#zn()}#zn(){this.container.addEventListener("toggle",this.#Ln.bind(this)),this.#Wn.forEach((e=>e.addEventListener("click",this.#Kn.bind(this)))),this.querySelector(fg).addEventListener("click",this.#qn.bind(this))}#Hn(){this.#jn.forEach((e=>{this.#Gn(e)}))}#Gn(e){const t=e.dataset.values?.split("; ")||[],n=e.dataset.buttonGroup;t.forEach(((t,r)=>{e.appendChild(this.#Vn(n,t,r))}))}#Vn(e,t,n){const r=document.createElement("button");return r.dataset.style=e,r.style.setProperty(e,t),r.dataset.value=t,r.classList.add("lexxy-highlight-button"),r.name=e+"-"+n,r}#Ln({newState:e}){"open"===e&&this.editor.getEditorState().read((()=>{this.#Jn(vi())}))}#Kn(e){e.preventDefault();const t=e.target.closest(pg);if(!t)return;const n=t.dataset.style,r=t.dataset.value;this.editor.dispatchCommand("toggleHighlight",{[n]:r}),this.close()}#qn(e){e.preventDefault(),this.editor.dispatchCommand("removeHighlight"),this.close()}#Jn(e){if(!si(e))return;const t=al(e,"color",mg),n=al(e,"background-color",mg);this.#Wn.forEach((e=>{const r=e.dataset.value===t||e.dataset.value===n;e.setAttribute("aria-pressed",r)}));const r=t!==mg||n!==mg;this.querySelector(fg).disabled=!r}get#jn(){return this.querySelectorAll("[data-button-group]")}get#Wn(){return Array.from(this.querySelectorAll(pg))}});class yg{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=Ed("li",{role:"option",id:Ld("prompt-item"),tabindex:"0"});return n.classList.add("lexxy-prompt-menu__item"),n.appendChild(t),n}async loadPromptItemsFromUrl(e){try{const t=await fetch(e),n=Td(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}class _g extends yg{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#Zn(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#Zn(e,t){const n=[];return this.promptItemByListItem=new WeakMap,e.forEach((e=>{const r=e.getAttribute("search");if(!t||function(e,t){return ng(e).includes(ng(t))}(r,t)){const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),n.push(t)}})),n}}class bg extends _g{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class xg extends _g{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}class kg extends yg{constructor(e){super(),this.baseURL=e,this.loadAndFilterListItems=function(e,t){let n;return(...r)=>(clearTimeout(n),new Promise(((i,s)=>{n=setTimeout((async()=>{try{const t=await e(...r);i(t)}catch(e){s(e)}}),t)})))}(this.fetchFilteredListItems.bind(this),200)}async buildListItems(e=""){return await this.loadAndFilterListItems(e)}promptItemFor(e){return this.promptItemByListItem.get(e)}async fetchFilteredListItems(e){const t=await this.loadPromptItemsFromUrl(this.#Yn(e));return this.#Zn(t)}#Yn(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#Zn(e){const t=[];this.promptItemByListItem=new WeakMap;for(const n of e){const e=this.buildListItemElementFor(n);this.promptItemByListItem.set(e,n),t.push(e)}return t}}class vg extends HTMLElement{constructor(){super(),this.keyListeners=[]}static observedAttributes=["connected"];connectedCallback(){this.source=this.#Xn(),this.#Qn(),this.toggleAttribute("connected",!0)}disconnectedCallback(){this.source=null,this.popoverElement=null}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#n()))}get name(){return this.getAttribute("name")}get trigger(){return this.getAttribute("trigger")}get supportsSpaceInSearches(){return this.hasAttribute("supports-space-in-searches")}get open(){return this.popoverElement?.classList?.contains("lexxy-prompt-menu--visible")}get closed(){return!this.open}get#er(){return!this.supportsSpaceInSearches}#Xn(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new kg(e):new xg(e):new bg(this.querySelectorAll("lexxy-prompt-item"))}#Qn(){const e=this.#tr.registerUpdateListener((()=>{this.#tr.read((()=>{const{node:t,offset:n}=this.#xt.selectedNodeWithOffset();if(t&&Jr(t)&&n>0){const r=t.getTextContent();if(r[n-1]===this.trigger){const t=1===n,i=n>1?r[n-2]:null;(t||(" "===i||"\n"===i))&&(e(),this.#nr())}}}))}))}#rr(){this.cursorPositionListener=this.#tr.registerUpdateListener((()=>{this.closed||this.#tr.read((()=>{const{node:e,offset:t}=this.#xt.selectedNodeWithOffset();if(e)if(Jr(e)&&t>0){const n=e.getTextContent().slice(0,t).lastIndexOf(this.trigger);(-1===n||t<=n)&&this.#ir()}else this.#ir()}))}))}#sr(){this.cursorPositionListener&&(this.cursorPositionListener(),this.cursorPositionListener=null)}get#tr(){return this.#or.editor}get#or(){return this.closest("lexxy-editor")}get#xt(){return this.#or.selection}async#nr(){this.popoverElement??=await this.#ar(),this.#lr(),await this.#cr(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#ur(),this.#or.addEventListener("keydown",this.#dr),this.#or.addEventListener("lexxy:change",this.#cr),this.#hr(),this.#rr()}#hr(){this.keyListeners.push(this.#tr.registerCommand(bn,this.#gr.bind(this),3)),this.keyListeners.push(this.#tr.registerCommand(wn,this.#gr.bind(this),3)),this.#er&&this.keyListeners.push(this.#tr.registerCommand(xn,this.#gr.bind(this),3)),this.keyListeners.push(this.#tr.registerCommand(yn,this.#pr.bind(this),3)),this.keyListeners.push(this.#tr.registerCommand(_n,this.#fr.bind(this),3))}#pr(e){return this.#mr(),e.preventDefault(),!0}#fr(e){return this.#yr(),e.preventDefault(),!0}#ur(){const e=this.#_r[0];e&&this.#br(e)}get#_r(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#br(e){this.#xr(),e.toggleAttribute("aria-selected",!0),e.scrollIntoView({block:"nearest",behavior:"smooth"}),e.focus(),this.#xt.preservingSelection((()=>{this.#or.focus()})),this.#kr.setAttribute("aria-controls",this.popoverElement.id),this.#kr.setAttribute("aria-activedescendant",e.id),this.#kr.setAttribute("aria-haspopup","listbox")}#xr(){this.#_r.forEach((e=>{e.toggleAttribute("aria-selected",!1)})),this.#kr.removeAttribute("aria-controls"),this.#kr.removeAttribute("aria-activedescendant"),this.#kr.removeAttribute("aria-haspopup")}#vr(){const{x:e,y:t,fontSize:n}=this.#xt.cursorPosition,r=this.#or.getBoundingClientRect(),i=this.#kr.getBoundingClientRect().top-r.top;this.popoverElement.hasAttribute("data-anchored")||(this.popoverElement.style.left=`${e}px`,this.popoverElement.toggleAttribute("data-anchored",!0)),this.popoverElement.style.top=`${t+i}px`,this.popoverElement.style.bottom="auto";const s=this.popoverElement.getBoundingClientRect();(s.bottom>window.innerHeight||this.popoverElement.hasAttribute("data-clipped-at-bottom"))&&(this.popoverElement.style.top=t+i-s.height-n+"px",this.popoverElement.style.bottom="auto",this.popoverElement.toggleAttribute("data-clipped-at-bottom",!0))}#lr(){this.popoverElement.removeAttribute("data-clipped-at-bottom"),this.popoverElement.removeAttribute("data-anchored")}async#ir(){this.#xr(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#or.removeEventListener("lexxy:change",this.#cr),this.#or.removeEventListener("keydown",this.#dr),this.#Sr(),this.#sr(),await Md(),this.#Qn()}#Sr(){this.keyListeners.forEach((e=>e())),this.keyListeners=[]}#cr=async()=>{this.initialPrompt?this.initialPrompt=!1:this.#wr.containsTextBackUntil(this.trigger)?(await this.#Cr(),await Md(),this.#vr()):this.#ir()};async#Cr(){const e=this.#wr.textBackUntil(this.trigger),t=await this.source.buildListItems(e);this.popoverElement.innerHTML="",t.length>0?this.#Er(t):this.#Tr(),this.#ur()}#Er(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#Tr(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=Ed("li",{innerHTML:this.#Nr});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#Nr(){return this.getAttribute("empty-results")||"Nothing found"}#dr=e=>{"Escape"===e.key&&(this.#ir(),this.#or.focus(),e.stopPropagation())};#yr(){const e=this.#Ar+1;e<this.#_r.length&&this.#br(this.#_r[e])}#mr(){const e=this.#Ar-1;e>=0&&this.#br(this.#_r[e])}get#Ar(){return this.#_r.findIndex((e=>e.hasAttribute("aria-selected")))}get#Lr(){return this.#_r[this.#Ar]}#gr(e){return e.preventDefault(),e.stopPropagation(),this.#Pr(),!0}#Pr(){this.#Or(),this.#ir(),this.#or.focus()}#Or(){const e=this.source.promptItemFor(this.#Lr);if(!e)return;const t=e.querySelector("template[type='editor']"),n=`${this.trigger}${this.#wr.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#Ir(t,n):this.#Fr(e,t,n)}#Ir(e,t){this.#tr.update((()=>{const n=yc(this.#tr,Td(`${e.innerHTML}`));this.#wr.replaceTextBackUntil(t,n)}))}#Fr(e,t,n){this.#tr.update((()=>{const r=new Bd({sgid:e.getAttribute("sgid"),contentType:`application/vnd.actiontext.${this.name}`,innerHtml:t.innerHTML});this.#wr.replaceTextBackUntil(n,r)}))}get#wr(){return this.#or.contents}get#kr(){return this.#or.editorContentElement}async#ar(){const e=Ed("ul",{role:"listbox",id:Ld("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.setAttribute("nonce",cl()),e.append(...await this.source.buildListItems()),e.addEventListener("click",this.#Rr),this.#or.appendChild(e),e}#Rr=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#br(t),this.#Pr())};#n(){this.disconnectedCallback(),this.connectedCallback()}}customElements.define("lexxy-prompt",vg);class Sg extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.#Dr(),this.#Mr()}#Dr(){this.languagePickerElement=this.#zr(),this.languagePickerElement.addEventListener("change",(()=>{this.#Br(this.languagePickerElement.value)})),this.languagePickerElement.style.position="absolute",this.languagePickerElement.setAttribute("nonce",cl()),this.editorElement.appendChild(this.languagePickerElement)}#zr(){const e=Ed("select",{hidden:!0,className:"lexxy-code-language-picker","aria-label":"Pick a language…",name:"lexxy-code-language"});for(const[t,n]of Object.entries(this.#$r)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#$r(){const e={...Su};e.ruby||(e.ruby="Ruby"),e.php||(e.php="PHP"),e.go||(e.go="Go"),e.bash||(e.bash="Bash"),e.json||(e.json="JSON"),e.diff||(e.diff="Diff");const t=Object.entries(e).sort((([,e],[,t])=>e.localeCompare(t))),n=t.findIndex((([e])=>"plain"===e)),r=t.splice(n,1)[0];return Object.fromEntries([r,...t])}#Br(e){this.editor.update((()=>{const t=this.#Ur();t&&t.setLanguage(e)}))}#Mr(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{const e=this.#Ur();e?this.#Hr(e):this.#Wr()}))}))}#Ur(){const e=vi();if(!si(e))return null;const t=e.anchor.getNode(),n=t.getParent();return lu(t)?t:lu(n)?n:null}#Hr(e){const t=e.getLanguage();this.#Kr(t),this.#qr(),this.#jr(e)}#Kr(e){if(this.languagePickerElement&&e){const t=Cu(e);this.languagePickerElement.value=t}}#jr(e){const t=this.editor.getElementByKey(e.getKey());if(!t)return;const n=t.getBoundingClientRect(),r=this.editorElement.getBoundingClientRect(),i=n.top-r.top;this.languagePickerElement.style.top=`${i}px`}#qr(){this.languagePickerElement.hidden=!1}#Wr(){this.languagePickerElement.hidden=!0}}function wg(){document.querySelectorAll("pre[data-language]").forEach((e=>{!function(e){const t=e.getAttribute("data-language");let n=e.innerHTML.replace(/<br\s*\/?>/gi,"\n");const r=Prism.languages[t];if(!r)return;n=(new DOMParser).parseFromString(n,"text/html").body.textContent||"";const i=Prism.highlight(n,r,t),s=Ed("code",{"data-language":t,innerHTML:i});e.replaceWith(s)}(e)}))}customElements.define("lexxy-code-language-picker",Sg),window.Prism=window.Prism||{},Prism.manual=!0;export{wg as highlightAll};
|